Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: billi on December 01, 2004, 08:39:24 AM

Title: Rsync restore of /etc backup
Post by: billi on December 01, 2004, 08:39:24 AM
I have been using Rsync to backup a server across the internet and it seems to work well.
I had to do a restore the other day (hdr failure) and  used the following command line to get the home directory back
rsync -avz -e 'ssh -p 22' root@bkup-server:/bkup-dir/home/e-smith/ /home/e-smith
where bkup-server is a registered dns name at dyndns.org and /bkup-dir is the directory that I saved the backup to on the backup server.
To restore the /etc files I tried rsync -avz -e --exclude-from=etc-exlude 'ssh -p 22' root@bkup-server:/bkup-dir/etc/ /home/e-smith
I wanted to use the exlude file 'cause I backup the whole etc directory on the backup - just incase you know.
My problem is I cannot get the exclude file to work correctly.

I have tried many combo's on this but I get either too much (whole e-smith dir) or to little ( the directory structure but no content). Following is one such attempt (the anotation is for a bit of clarity and was not included in the file) :

# file name etc-exclude
+ /e-smith      # used so rsync could recurse to ones below
+ /e-smith/templates-custom/   # restore essential whole dir
+ /e-smith/templates-users-custom/   # restore essential whole dir
+ /ssh/     # restore essential whole dir
+ /samba/    # restore essential whole dir
+ /group    # restore essential file
+ /gshadow     # restore essential file
+ /passwd     # restore essential file
+ shadow       # restore essential file
- *       # excludes all other files and dir's

Does anyone know the right syntax for this file?

PS  the \root directory should be restored also to match the flexbackup backup set.
Thanks