I have two hard drives, one is for daily use and another one is for backup needs. How to backup between those 2 hard drives in linux using command line (CLI) tools? Easy! Linux already have superb program called rsync, which can be used for backup or synchronize between two folder or drives or from hard drives to USB disk. Here is the command:
$ sudo rsync -avu –delete [source path] [destination path]
for example in my case:
$ sudo rsync -avu –delete /home/banteng/Business /media/2825dc9d-7018-49e0-bac4-2567a1d1a380/backup/Business/
options –delete (minus minus delete) is for deleting files or directories that is no longer exist in the source path, if you don’t use –delete then files or folder that is no longer exist still kept in the destination path.
You can combine this command with crontab so, you can run routine backup automatically for specific period, ie daily, weekly, etc….