Search This Blog

Wednesday, 23 January 2013

Backup with tar and rsync

For example to archive your home directory you could use the following command:
tar cvfj home.tar.bz2 --exclude=home.tar.bz2 /home/myusername 
The integrity of the compressed archive can then be tested by decompressing it again:
tar xvjf home.tar.bz2 -O > /dev/null

Until recently I believed that the cp command was safe. However I observed that it fails quite regularly when copying large files to a windows file system. I hope rsync can solve this problem:
rsync -av home.tar.bz2 /windows_partition/ 

1 comment:

  1. By now, I have also seen rsync failing. The next thing I try is to remove the file before calling rsync.

    ReplyDelete