I’ve been using rsync as my MacGyver style backup-tool of choice on *nix systems and sometimes even Windows systems.
It works both locally and remotely, is simple to setup and over the years has gathered a lot of nifty functionality.
It is way easier to backup using rsync one directory to another than using tar (tar has the benefit of putting everything in one archive though) using a command like this:
rsync -aiv /path/to/source/directory /path/to/destination/directory
For remote copies, I usually add replace -aiv
with -aivz
or with -aiz
.
Given the ubiquitous of hard disk space, I hardly compress or archive directory trees for archival purposes any more.
For an introduction of basic functionality read Everything Linux – A Tutorial on Using Rsync. An article from 1999 that is still very valid now.
Besides my praise for rsync, there are a few small things I want to mention in this article:
- Sometimes more is less. Recently someone asked me how to force rsync not to keep the time stamps of files.
He wasn’t the first to ask.
The solution is simple: since the -a
option archive option implies -t
, so the solution is to expand -a
into its parts -rlptgoD
, then remove the -t
from that.
- The –link-dest=DIR option was added in about 2004 (later: no, link-dest was added to rsync 2.5.6 in januari 2003), which allows you to do incremental backups. Read the rest of this entry »
Like this:
Like Loading...