LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-27-2014, 02:00 AM   #1
chriscrutch
LQ Newbie
 
Registered: Mar 2007
Posts: 7

Rep: Reputation: 0
Rsync guru needed


I need an rsync wizard.

The situation: I use rsync to backup my /home folder to an external HD. / is on one internal drive, /home/chriscrutch is on that same internal drive, /home/chriscrutch/Documents is a symlink to a folder on a different internal drive. Because it's a symlink, I have to use the rsync option to transform symlinks into the referent file, otherwise none of the files in that folder (or sub-folders) get backed up.

The problem: transforming symlinks into the file results in clogging the backup drive with old files no longer present in the source, even with the --delete option. That's fine for a while, but after a time my backup drive runs out of space because of the storage of old, long-deleted files. Is there a way to get rsync to clean those out even though they're all, sort of, symlinks as opposed to regular files?

The command:
Code:
rsync -r -t -p -o -g -v --delete -D --partial -L /home/chriscrutch /media/truecrypt1
Thanks!

--chriscrutch
 
Old 01-27-2014, 03:54 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
I would split the problem you are facing with the above rsync command into two rsync commands.

The rsync command as shown creates real files when it encounters symlinks and, as noticed, you will end up with files that aren't removed.

Why not use one rsync command to back up your home directory (including safe simlinks) and one rsync command to back up the data that is outside your home directory.

safe simlinks are those that stay inside the tree:
- A link from /home/chriscrutch/foo to /home/chriscrutch/Tmp/foo is safe
- A link from /home/chriscrutch/bar to /data/chriscrutch/bar is unsafe.

You could use something like this to back up your home directory:
Code:
rsync -a -v --delete -D --partial --safe-links /home/chriscrutch /media/truecrypt1
And something similar for the real location of Documents.
 
  


Reply

Tags
rsync


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
KDE Guru needed AxXium Slackware 15 06-03-2005 07:04 PM
Linux printing guru needed J_Szucs Linux - Hardware 0 12-01-2004 12:56 PM
Perl guru needed J_Szucs Programming 1 10-11-2004 03:05 AM
Linux Guru Needed !!! Tuzinor Linux - General 6 11-17-2002 05:40 PM
guru help needed. dk Linux - Newbie 2 04-26-2001 12:03 PM

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

All times are GMT -5. The time now is 07:34 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