LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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
 
LinkBack Search this Thread
Old 07-13-2011, 01:37 PM   #1
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Squeeze
Posts: 426

Rep: Reputation: 37
Rsync: backups and hard links


I am using rsync for incremental backups. I am backing up to a second hard drive on my computer. When I check the individual backup directories (backup.0 through backup.4) with du -hs they each show 12G; when I check the parent directory squeeze it shows 15G. Over 4 backups I have added 3G. I haven't made very much for changes to directories I'm backing up and am using hard links. I have included some info below. Maybe someone can show me what is wrong.

Quote:
Backup script:
#!/bin/bash
mount /mnt/backup
cd /mnt/backup/squeeze/
rm -rf backup.7
mv backup.6 backup.7
mv backup.5 backup.6
mv backup.4 backup.5
mv backup.3 backup.4
mv backup.2 backup.3
mv backup.1 backup.2
mv backup.0 backup.1
cd /
rsync -am --delete-after --filter="merge /root/scripts/filter-rule" --delete-excluded \
--link-dest=/mnt/backup/squeeze/backup.1 \
/ /mnt/backup/squeeze/backup.0
umount /mnt/backup
Quote:
filter-rule:
- /home/joe/downloads/
- /home/joe/.local/share/Trash/
+ /home/
+ /etc/
+ /root/
+ /boot/
+ /usr/
+ /usr/local/
- /usr/*
- /*

Last edited by JosephS; 07-13-2011 at 08:59 PM.
 
Old 07-13-2011, 02:03 PM   #2
arizonagroovejet
Member
 
Registered: Jun 2005
Location: England
Distribution: SLED 11, openSUSE 11.4
Posts: 965

Rep: Reputation: 165Reputation: 165
Put output, commands, scripts and such in CODE tags. It makes your post easier to read. (CODE tags can be added using the button marked # when composing a post)

I don't think I entirely understand your description of the problem - are you saying that the source directory contains hardlinks and has a total size of 12GB but the destination directory ends up containing 15GB? If so, look at the -H option.
 
Old 07-13-2011, 09:39 PM   #3
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Squeeze
Posts: 426

Original Poster
Rep: Reputation: 37
Sorry about the confusion. I am backing up from drive A to B. I am backing up the directories in the filter rule under / to /mnt/backup/squeeze/backup.0. There are no hard links in the source directory. The hard links are on the destination directory. With the --link-dest=/mnt/backup/squeeze/backup.1 rsync hard links unchanged files in backup.0/ to backup.1/ and copies new or changed files from the source directories under / to backup.0/
I don't make many changes so with the hard links I can't see why there is so much extra space taken. If most of the files under /mnt/backup/squeeze/ are hark linked (backup.0 through backup.4) and show each 12G why is /mnt/backup/squeeze/ 15G?

Quote:
Here is quote from an article:
--link-dest this is a neat way to make full backups of your computers without losing much space. rsync links unchanged files to the previous backup (using hard-links, see below if you don’t know hard-links) and only claims space for changed files. This only works if you have a backup at hand, otherwise you have to make at least one backup beforehand.
 
  


Reply

Tags
backups, hard links, incremental, 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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] rsync --link-dest not creating hard links on external usb drive quasi3 Linux - General 4 08-26-2009 10:11 AM
rsync - Backups pkraus109 Linux - Server 2 05-21-2009 12:36 PM
Rsync backups gabsik Linux - General 3 11-24-2006 07:14 PM
Rsync - Backup vs. Hard Links Only hazmatt20 Linux - Software 2 08-18-2006 07:32 AM
Rsync backups gabsik Linux - Networking 1 03-30-2006 10:31 AM


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

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration