--link-dest

Matt McCutchen hashproduct+rsync at gmail.com
Thu Jan 4 01:25:43 GMT 2007


On 1/3/07, tony.chamberlain at lemko.com <tony.chamberlain at lemko.com> wrote:
> So would you suggest each day doing this:
>
>      K=`readlink newest`
>      BK=backup.`date +"%y%m%d"`
>      rsync -a --delete --link-dest=$K/   source/   $BK/
>      rm newest
>      ln -s $BK newest
>
> But the first time I would do, just
>
>      BK=backup.`date +"%y%m%d"`
>       cp -a  source  $BK
>      ln -s $BK newest

That would work.  Or you could have the script check whether "newest"
exists and use --link-dest if so; that way the same script would work
for the first backup and subsequent backups.  Or you could use a
program that manages the backups for you, such as rsnapshot (
http://www.rsnapshot.org/ ).

Matt


More information about the rsync mailing list