Re: Questions with rsync

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

 



GMS S wrote:
[
I would pretty much recommend that you specifically omit /dev and /proc
too.

Save the filter to a text file and make it look something like this (I
like the first one but you might not). + and - symbols should be
obvious.

- ~*
- /lost+found/
+ **/home/user/backup

rsync -vpa --filter='. /path/to/rsync-filter' $source $destination

I didn't think '-a' option indicates compression at all, only 'archive'
and you might want '-u' option for update.

Craig
]

So what would be the final command if I exclude these directory?

/lost+found
/media
/mnt
/dev
/proc
/home/user/backup
/dev

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:

	/proc/*
	/sys/*
	/dev/*
	/media/*

Tweak as you see fit.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer                      ricks@xxxxxxxx -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-                   To err is human, to moo bovine.                  -
----------------------------------------------------------------------

--
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]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux