Has anyone else had problems using the --link-dest flag? I do what it says in the example rsync -a --delete --link-dest=/home/chamberl/oldbk/ /home/chamberl/source/ /home/chamberl/backup/ I make sure that /home/chamberl/source has some files exactly the same as in /home/chamberl/oldbk/ but evertything gets copiued, and no hard links are done (though they should be). Anyone know the problem? -------------- next part -------------- HTML attachment scrubbed and removed
On 1/2/07, tony.chamberlain@lemko.com <tony.chamberlain@lemko.com> wrote:> rsync -a --delete --link-dest=/home/chamberl/oldbk/ > /home/chamberl/source/ /home/chamberl/backup/ > > I make sure that /home/chamberl/source has some files exactly the same as in > /home/chamberl/oldbk/ > but evertything gets copiued, and no hard links are done (though they should > be).Rsync only makes hard links if the source files match the oldbk files in all preserved attributes. Since you used -a, these attributes are permissions and modification time, plus user and group if rsync runs as root. Do these attributes match between source and oldbk files? Matt
On Tue, Jan 02, 2007 at 09:17:30PM +0000, tony.chamberlain@lemko.com wrote:> rsync -a --delete --link-dest=/home/chamberl/oldbk/ /home/chamberl/source/ /home/chamberl/backup/ > > I make sure that /home/chamberl/source has some files exactly the same as in /home/chamberl/oldbk/ > but evertything gets copiued, and no hard links are done (though they should be).Is /home/chamberl/backup empty? Or does it have files already? The --link-dest option is designed to work into an empty hierarchy, as the presence of a prior file causes rsync to update that file rather than look for a match in the link-dest dir(s). Are the files in the oldbk and source dir identical clear down to their attributes (time, ownership, permissions, ...)? ..wayne..
I hope this is responding to the several people who responded. Thanks for responding. You all had the same question, whether all the characteristics of the files are the same. To know for sure I have to wait till I get back to work tomorrow, Basically I did cp -r source dest this was to make an exact backup of source, so I could later rsync source with link-dest set to dest. Basically cp -r source dest rsync -a --delete --link-dest=dest/ source/ bkup/ of course, dest, source, and bkup were actually different names. I just called them source, dest, bkup for ease of reading above. The source directory had simple files. I just did for a in a b c do date > $a done just made files a, b, and c with the date. Looking at the inodes, every file had a different inode. And if I edited (vi) bkup/c and added lines to it, in dest/c the file was not changed, showing it was not linked. -------------- next part -------------- HTML attachment scrubbed and removed
On 1/3/07, tony.chamberlain@lemko.com <tony.chamberlain@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 newestThat 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
Please consider copying the rsync list so that other people can help you and so that your messages will be available to users who have similar questions in the future. On 1/5/07, tony.chamberlain@lemko.com <tony.chamberlain@lemko.com> wrote:> rsnapshot seems to work pretty well for some things. I have a question. > Say I am on machine foo and > want to put in my backup to bar > > > /home/chamberl/ backup@bar:chamberl/ > > somewhere on backup it will make the chamberl directory. On foo I have a > snapshot_root so if i had done > this locally it would put under $snapshot_root/chamberl/. > > So does this mean that on machine bar I need an rsnapshot.conf file with the > snapshot root? Or do i somehow have a > remote snapshot root in the conf file on foo? Or would it just go to a > default directory on bar and I cannot specify > a root?Rsnapshot supports only local snapshot roots and only local backup destinations within those snapshot roots. A configuration line like this will not work as you expect: backup /home/chamberl/ backup@bar:chamberl/ Thus, if you want the snapshot stored on bar, you need to run rsnapshot *on bar* with an rsnapshot.conf giving the desired local snapshot root. So how do the files from foo get there? If bar can access foo via SSH, the easiest thing to do is to have bar pull the files from foo by specifying a remote backup source: backup foo:/home/chamberl/ chamberl/ An alternative is to have foo push the files to a temporary area on bar and then run rsnapshot to pick them up from there. You could set up your own temporary area and specify it as the backup source, or foo could push the files directly to the .sync directory in the snapshot root and rsnapshot could run in sync_first mode to convert that directory to a snapshot. A nice way to automate the process is to run an rsync daemon on bar that accepts the pushed files into the correct directory and calls rsnapshot as the post-xfer exec command. Some hints on how to do this are here: http://lists.samba.org/archive/rsync/2006-April/015347.html Matt