I use rsync command to sync some local directories to my external HDD. I wrote a simple bash script to do this job. I’d set up a reminder service to get notification on weekly basis. On getting that reminder, I just run this bash script to synchronize files.
Some advantages and features of rsync command-
1. It efficiently copies and sync files to or from a remote system.
2. Supports copying links, devices, owners, groups and permissions.
3. It’s faster than scp because it uses remote-update protocol which allows to transfer just the differences between two sets of directories. First time, it copies the whole content of a directory from source to destination but from next time, it copies only the changed blocks and bytes to the destination.
Here is its basic implementation
#!/bin/bash #sync docs, delete files that are not there in source directory rsync -rzvhW --delete /home/kuntal/Documents/ /media/FreeAgent\ GoFlex\ Drive/My\ Data/Docs/ #sync photos rsync -rzvhW /home/kuntal/Pictures/ /media/FreeAgent\ GoFlex\ Drive/My\ Data/Photos/ #sync study materials, delete files that are not there in source directory rsync -rzvhW --delete /home/kuntal/Study\ Materials/ /media/FreeAgent\ GoFlex\ Drive/My\ Data/Study\ Materials/ #sync movies rsync -rzvhW /home/kuntal/Videos/ /media/FreeAgent\ GoFlex\ Drive/My\ Data/Movies/
That’s all to sync all of my required data.