Re: Questions with rsync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03Jun2009 11:00, Rick Stevens <ricks@xxxxxxxx> wrote:
> GMS S wrote:
> I use this sort of thing with a 500GB USB drive (automounted at
> "/media/500GB-Drive" by Gnome):
>
> 	#!/bin/bash
> 	# Back up system to a specific directory given on the command
> 	# line or a default based on today's date.  Excludes the /proc,
> 	# /sys, /dev and /media directories
> 	MYHOST=`hostname`
> 	TODAY=`date +%d-%b-%Y`
> 	if [ $# -lt 1 ]; then
> 	    TGT="/media/500GB-Drive/$MYHOST-BackUp-$TODAY"
> 	else
> 	    TGT=$1
> 	fi
>
> 	rsync -avXA --exclude-from=/etc/skipdirs.rsync / $TGT
>
> with /etc/skipdirs.rsync containing:
[...]

I use an extra level of complexity on top of this approach: I hard link
the previous backup directory to the new date, then rsync to the new
date. This makes the cost-per-backup just the incremental cost of
changed files; unchanged files are thus hardlinked from the previous
backup.

Code here:
  http://www.cskk.ezoshosting.com/cs/css/bin/histbackup

Then:

  mkdir -p /media/500GB-Drive/backups
  histbackup -x / /media/500GB-Drive/backups -X

Histbackup automatically honours a .hbinclude file in the
backup area as an '--include-from' option, so you'd set up
/media/500GB-Drive/backups/.hbinclude as required.

There's a bunch of similar rsync-based backup scripts on the web for
this purpose.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

There's a fine line between cleverness and stupidity.
        - Nigel Tufnel, _Spinal Tap_

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux