rsync

rsync is an open source utility that provides fast incremental file transfer. rync is used as a backend in various backup utilities like Timeshift .

In the past i relied on rsync to syncrhonize the content across the computers at home. However around Mar'26, moved to syncthing for some of these tasks.

To backup Aadhirai folder from homepc to homepc2, issue the below command from aadhirai@homepc2:

aadhirai@homepc2 /d/d/Aadhirai> rsync -avh aadhirai@192.168.1.199:/data/docs/Aadhirai/ /data/docs/Aadhirai/ --delete-after

To backup data to a hard disk formatted as FAT32, use the below command:

rsync --progress --modify-window=1 --update --recursive --times
/media/DDrive/Backup /media/prabu/DATA/

To allow correct time comparison –modify-window=1 option is used, because FAT32 records file timestamps with 2-seconds resolution which is different to filesystem(s) used on Linux. The –update to avoid unnecessary copying of existing files - it behaves like incremental backup.

In order to do size-based comparison, you can specify –size-only option.

To run rsync between client and server, need to set up passwordless login to ssh first before running rsync. And rsync need to be available on both the machines. The BTRFS page has necessary instructions.

Using tar command

$ tar -X tarexclusions -zcvf homefolder.tar.gz /home
$ cat tarexclusions
*cache*
*Cache*
*thumbnails*
*.mp4
*.mp3
*.flv
*.wmv
$ sudo tar -X tarexclusions -zcvf /mnt/backup/homefolder-$(date+%d-%m-%Y).tar.gz /home
$ cat tarexclusions
*cache*
*Cache*

The above tar command produced the file named homefolder-21-07-2020.tar.gz

Use -p to preserve permissions if running tar as non-super user.

Sources:


© Prabu Anand K 2020-2026