ajhsu / blog

The external storage of my brain.
3 stars 0 forks source link

rsync #48

Open ajhsu opened 7 years ago

ajhsu commented 7 years ago

rsync

Recipes

A way to mimic the capabilities of Time Machine (macOS) - see also tym

# rsync interprets ":" as separator between host and port (i. e. host:port), so we cannot use %T or %H:%M:%S here, so we use %H-%M-%S
$ date=$(date "+%FT%H-%M-%S") 
$ rsync -aP --link-dest=$HOME/Backups/current /path/to/important_files $HOME/Backups/back-$date
$ ln -nfs $HOME/Backups/back-$date $HOME/Backups/current

Make a full backup of system root directory

 $ rsync -aczvAXHS --progress --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /* /path/to/backup/folder

Studying materials