Hot answers tagged

6

setfacl is designed to accept getfacl output as input. Meaning you can run getfacl, save the output to a file, do your thing, then restore the ACL. The exact procedure can vary depending on your platform. On Linux though: # Take a peek at the current ACL [root@vlp-fuger ~]# getfacl newFile # file: newFile # owner: root # group: root user::rw- group::r-- ...


3

If you want to avoid clobbering any backup files with GNU cp, you can use numbered backups: cp --backup=t source destination Rather than overwrite a backup, this creates additional backups. Example As an example, let's consider a directory with two files: $ ls file1 file2 Now, let's copy file1 over file2: $ cp --backup=t file1 file2 $ ls file1 ...


3

One way to exchange one directory component for another in zsh is the two-argument version of cd: cd old new This substitutes new for the first substring matching old and tries to change directory to the resulting path. For example: % pwd /path/to/my/backup/back-2015-07-02T21_18_01/home/myuser/myfiles/somedir/subdir/ % cd "5-07-02T21_18_01" "6-04-...


2

rsync has an option to limit the throughput; for example --bwlimit=1 is 1 kibibyte/second. Use a suffix of K M or G to multiply the number, the default being K. The man page talks about sockets, but it applies to local copies too. You can try running sudo smartctl -a /dev/sdx on your disk sdx to see if there are any indications of it suffering from over-...


2

Not particularly elegant, but you could run your copy command and then run a loop that pauses it for, say 3 minutes every 20 minutes: Launch your copy command in the background cp -r /path/to/dir /path/to/external/drive & Run this loop which will stop/restart it: while ps -p $! >/dev/null; do kill -SIGCONT $!; sleep 20m; kill -s ...


2

I like to be pragmatic, and since writing a zsh completion is outside my current skills, I'd just write a special purpose function using the select menu system from zsh (and bash). cdd(){ typeset dir typeset -a dirs if [[ $PWD =~ ^(.*)(/back-[0-9-]+T[0-9_]+/)(.*)$ ]] then for dir in "$match[1]"/*/"$match[3]" do [ "$dir" !=...


1

Your export line says 192.168.178.10(ro,sync,no_subtree_check,root_squash) The root_squash entry means "when remote user root tries to access the file, pretend the user is nobody instead. This means the remote root user has no privileged access at all. Instead change root_squash to no_root_squash. ie 192.168.178.10(ro,sync,no_subtree_check,...


1

The target disk must be a few kB smaller than the source disk. “500 GB” as a disk size means “at least 500,000,000,000 bytes”; you can't count on all 500 GB disks to have exactly the same number of bytes. Since all the partitions have the same size and position, the part at the end that doesn't fit isn't used anyway, so this isn't a problem. 45 MB/s is ...


1

If you have an USB stick bigger than 4 GB and you want to put big files on it, try NTFS. (You could also use Ext[234], but you wouldn't be able to read it on Windows, while NTFS naturally works on Windows). No more worrying if your file is bigger or smaller than than 4GB. Some graphical formatting programs will suggest NTFS as an option, otherwise man mkfs....


1

You can use squashfs to make a squashed version of your filesystem. First check if squashfs-tools is installed or not. I don't know the exact name of the package. So look up google to install it on your Ubuntu. After you install it, run- sudo mount /dev/xxx /mnt (Replace xxx with the proper partition name. This must be the partition where your OS is ...


1

The usual method is (writing from memory): NEWBACKUP=`date +%s` # or some other format cp -al "$OLDBACKUP" "$NEWBACKUP" rsync -aH --delete "$SOURCE" "$NEWBACKUP" Check out Easy Automated Snapshot-Style Backups with Linux and Rsync There is also a --link-dest option to rsync that I've never investigated properly.


1

The command tar czf /media/masi/ntfsDisc/backup_home.tar.gz $HOME/ is the same as this: tar cf - $HOME/ | gzip > /media/masi/ntfsDisc/backup_home.tar.gz When you ran top, it showed the gzip was using up around 100% of one cpu thread. The NTFS FUSE software is using up a nonzero amount of CPU, too, but essentially you're CPU-bound because of that ...



Only top voted, non community-wiki answers of a minimum length are eligible