LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-09-2014, 09:15 AM   #1
sammckee
Member
 
Registered: Aug 2003
Posts: 59

Rep: Reputation: 15
rsync --link-dest not working?


On my backup server I have a script that runs as root:

Quote:
mv ~/system_backup/daily/current ~/system_backup/daily/today
mkdir ~/system_backup/daily/current

/usr/bin/rsync --verbose --archive --one-file-system --link-dest=/home/backups/system_backup/daily/today/ -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --hard-links --human-readable --inplace --progress --delete-excluded --numeric-ids --exclude-from=/home/backups/system_backup/excludes.txt root@10.1.101.108:/ /home/backups/system_backup/daily/current/

mv ~/system_backup/daily/today ~/system_backup/daily/`date +%F`-data
The idea is this:
At any given time there's a directory current containing the most recent backup.

When the backup process starts, current gets renamed to today and a new current is created. A new backup is created in the new current using today as the link-dest. Then the today is renamed with a date string.

It creates the backup I expect, but it always creates complete new copies of all files rather than creating hardlinks to the unchanged files in the link-dest. This completely fills up the drive after about three backups. Any idea what I'm doing wrong?

Thanks!
Sam
 
Old 05-10-2014, 07:52 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,460

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Not sure why it doesn't work, but maybe take a look at rdiff-backup?

http://www.nongnu.org/rdiff-backup/

It basically does what you want - keeping backups of changed/deleted files without waisting diskspace on files that do not change.
 
Old 05-10-2014, 11:27 AM   #3
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Your rsync command looks good to me.

Try adding the --log-file=FILE option, and keep the -v or ---verbose (which affects logfile verbosity too). In the log file, look for lines like the following:

When the file is originally transferred, and there is nothing to link to:
Code:
2014/05/10 11:40:04 [9816] >f+++++++++ Screenshot from 2014-04-22 12:16:25.png
If the file has been modified, so both the size and timestamp do not match those of the corresponding file in --link-dest, you get a line like this:
Code:
2014/05/10 11:53:58 [10462] >f.st...... Screenshot from 2014-04-22 12:16:25.png
When there is a matching file in the --link-dest directory, no such line appears.
 
Old 05-10-2014, 11:28 AM   #4
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
And here is a stupid question: Does the destination filesystem support hardlinks? (Some, like FAT32, do not.)
 
Old 05-10-2014, 12:46 PM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
you might also look into the

Quote:
-H, --hard-links preserve hard links
from the man page.

hmm nm i see you are. sorry ignore this post.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync in conjunction with the --link-dest option does not output deleted files maikelmeyers Programming 3 01-04-2013 05:06 PM
Questions about rsync and '--link-dest' flag donnaaparis Linux - General 1 07-14-2011 12:55 PM
rsync log format option (--link-dest) rbalaa Linux - Server 2 04-03-2010 09:53 AM
[SOLVED] rsync --link-dest not creating hard links on external usb drive quasi3 Linux - General 4 08-26-2009 10:11 AM
Problem using rsync for backups: link-dest JosephS Linux - Software 0 02-21-2008 07:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration