Rsync is a pretty powerful utility to backup and synchronize your data to other storage media such as hard disks, the samba share, external ssh servers and the other. This time I will try to explain how to backup or synchronize data from Linux to external hard disk storage media.
A. Mount The External Hard Disk
Before discussing how to use rsync, first make sure you are able to mount your external hard disk to a folder in Linux. Use the following command to mount your external hard disk NTFS formatted into "/mnt/disk1" on Linux.
mount -t ntfs-3g /dev/sda1 /mnt/disk1
Please replace "/dev/sda1" with an external partition on your hard disk. You can find out your external hard disk partition with the following command
sudo fdisk -l
Make sure you also replace "/mnt/disk1" with your own got.
B. Install Rsync
If you have not been there in Linux application or package rsync, please install with the following command (Ubuntu)
sudo apt-get install rsync
C. Process backups with Rsync
After all ready, now we can start doing backups with rsync. The following command will do a backup and synchronize a folder "/home/fitri" to your external hard disk.
sudo rsync -avv --delete /home/fitri /mnt/disk1
For incremental backups, remove options --delete
sudo rsync -avv /home/fitri /mnt/disk1
To use a command or option of rsync, you can see with the command
sudo rsync --help