rsync is a very versatile copying tool. When I was writing about backing up an lvm and restoring backups, I quickly forgot about rsync. Rsync is a remarkable tool that copies files from a source to a destination quickly comparing the file size and modification times and only transfers the changed files. It's called delta-transfer and it saves on bandwidth. However, I keep my initial backups locally but it does save on time if only those changed files or new files are copied to the destination.
The general syntax of the rsync command is
$ rsync -av <options> <source> <destination>.
It's very simple and elegant.
My lv's are mounted on ~/Music and ~/Videos while my backup directory is /backups/Musicbackups and /backups/Videosbackups. To use rsync :
$ rsync -av ~/Music/ /backups/Musicbackups
$ rsync -av ~/Videos/ /backups/Videosbackups
That trailing backslash "/" in the source directory tells rsync to ignore copying the directory and just copy what's inside the directory. I'm avoiding extra directory levels onto the destination directory.
This operation can be automated. I'll write about it on the next post.
Comments