using RSYNC to back-up system to spare Partition
Dear SuSErs, Please could some 'Illuminati' help me get my cron-script right? :- I have problems because rsync is copying directory /proc [ including the huge kcore ], and also /mnt [ where I have mounted my backup partition /dev/hda6 ] , recursively. After looking at "man rsync" I am very unsure about how to get the syntax right ~ I need help to add the right "excludes" to my cron script :- ..................................... #!/bin/sh # # use rsync to backup / to /dev/hda6 on Thursday # mount -t reiserfs /dev/hda6 /mnt # df cd rsync -auvzr --delete / /mnt cd # next is to adjust book partition to hda6 cp /mnt/etc/fstab.bak /mnt/etc/fstab df umount /mnt cd .............................................. ~ many thanks ____________ sent on Linux ____________
pinto wrote:
Dear SuSErs,
Please could some 'Illuminati' help me get my cron-script right? :-
I have problems because rsync is copying directory /proc [ including the huge kcore ], and also /mnt [ where I have mounted my backup partition /dev/hda6 ] , recursively.
After looking at "man rsync" I am very unsure about how to get the syntax right ~ I need help to add the right "excludes" to my cron script :- .....................................
#!/bin/sh # # use rsync to backup / to /dev/hda6 on Thursday # mount -t reiserfs /dev/hda6 /mnt # df cd rsync -auvzr --delete / /mnt
don't use 'z', add '--delete-after'. so, rsync -auvr --delete --delete-after --exclude="proc" \ --exclude="mnt" / /mnt try dry runs, 'n' is your friend. are you sure yu want to use the 'u' option? also, make sure you create the /proc directory in your backup partition, otherwise you'll get a boot error when it gets mounted.
cd # next is to adjust book partition to hda6 cp /mnt/etc/fstab.bak /mnt/etc/fstab df umount /mnt cd ..............................................
-- Rafael
On Thursday 01 April 2004 12:42, Rafael E. Herrera wrote:
don't use 'z', add '--delete-after'. so,
rsync -auvr --delete --delete-after --exclude="proc" \ --exclude="mnt" / /mnt
try dry runs, 'n' is your friend. are you sure yu want to use the 'u' option?
also, make sure you create the /proc directory in your backup partition, otherwise you'll get a boot error when it gets mounted.
~ Very many thanks :) -- best wishes ____________ sent on Linux ____________
On Thu, Apr 01, 2004 at 07:42:29AM -0500, Rafael E. Herrera wrote:
rsync -auvr --delete --delete-after --exclude="proc" \ --exclude="mnt" / /mnt
Though it's not pretty, using the long switches will make your script more self-documenting, which might be especially nice if you're looking at this thing long in the future and have not memorized all the rsync options. So, the above would become: rsync --archive --update --verbose --recursive \ --delete --delete-after \ --exclude="proc" --exclude="mnt" / /mnt And, --archive implies --recursive, so you can eliminate it, leaving just: rsync --archive --update --verbose \ --delete --delete-after \ --exclude="proc" --exclude="mnt" / /mnt Once you get the script working the way you want, you might want to leave out the --verbose, so that rsync will work silently unless it encounters problems, in which case its output can be read by cron and sent to you. Part of the Unix way of doing things is having commands, by default, only report errors, so no news is good news. -- Phil Mocek
On Friday 02 April 2004 01:07, Phil Mocek wrote:
And, --archive implies --recursive, so you can eliminate it, leaving just:
rsync --archive --update --verbose \ --delete --delete-after \ --exclude="proc" --exclude="mnt" / /mnt
Once you get the script working the way you want, you might want to leave out the --verbose, so that rsync will work silently
~ Thank you kindly. What, please, does the back-slash mean, as in < --verbose \ > ?? -- best wishes, Richard ____________ sent on Linux ____________
On Thursday 01 April 2004 08:00 pm, pinto wrote:
On Friday 02 April 2004 01:07, Phil Mocek wrote:
And, --archive implies --recursive, so you can eliminate it, leaving just:
rsync --archive --update --verbose \ --delete --delete-after \ --exclude="proc" --exclude="mnt" / /mnt
Once you get the script working the way you want, you might want to leave out the --verbose, so that rsync will work silently
I have two machines running Suse 9.0. Can I use rsync to make the two machines mirror images of each other? Thanks, Jerome
On Friday 02 April 2004 17:46, Jerome Lyles wrote:
I have two machines running Suse 9.0. Can I use rsync to make the two machines mirror images of each other?
~ guess the answer is 'yes' -- best wishes ____________ sent on Linux ____________
On Fri, 2004-04-02 at 12:46, Jerome Lyles wrote:
On Thursday 01 April 2004 08:00 pm, pinto wrote:
On Friday 02 April 2004 01:07, Phil Mocek wrote:
And, --archive implies --recursive, so you can eliminate it, leaving just:
rsync --archive --update --verbose \ --delete --delete-after \ --exclude="proc" --exclude="mnt" / /mnt
Once you get the script working the way you want, you might want to leave out the --verbose, so that rsync will work silently
I have two machines running Suse 9.0. Can I use rsync to make the two machines mirror images of each other? Thanks, Jerome
You can for any data that needs to be mirrored but not recommended for system specific stuff like ip address info. Generally anything outside of /etc and /var might be able to be mirrored. I have flat file database files that I rsync from a server in Ft. Myers, FL to a server in Asheville, NC every night. Works like a champ. -- Ken Schneider unix user since 1989 linux user since 1994 SuSE user since 1998 (6.2)
On Thursday 01 April 2004 16:20, pinto wrote:
Please could some 'Illuminati' help me get my cron-script right? :-
I have problems because rsync is copying directory /proc [ including the huge kcore ], and also /mnt [ where I have mounted my backup partition /dev/hda6 ] , recursively.
Here is the copying code I use to clone a machine during boot. The model machine is mounted on /source the partitions to be filled are on /target The command that does it is this: rsync -aH --delete --exclude-from /source/etc/clone/exclude-list /source/ /target/ Where the file exclude-list contains this: cat exclude-list # file to control the rsync copy onto a new machine # Just the top level home directory + /home/ - /home/* # just the mount points + /media/ + /media/cdrom/ - /media/cdrom/* + /media/floppy/ - /media/floppy/* - /media/* # just mount points + /mnt/ - /mnt/* + /proc/ - /proc/* + /tmp/ - /tmp/* # All directories in /var/log + /var/log/**/ - /var/log/* - /var/log/**/* Hopefully this should give you enough examples to work out your problem, michaelj -- Michael James michael.james@csiro.au System Administrator voice: 02 6246 5040 CSIRO Bioinformatics Facility fax: 02 6246 5166
participants (6)
-
Jerome Lyles
-
Kenneth Schneider
-
Michael James
-
Phil Mocek
-
pinto
-
Rafael E. Herrera