I am try to backup entire server using rsync. Can someone help me with a script. The only thing i don't want include are /prc, /tmp and /lost+found I have root access on both servers i create an account on backup server called backup.
On Thursday 24 February 2005 06:35 am, chris allen wrote:> I am try to backup entire server using rsync. Can someone help me with > a script. The only thing i don't want include are /prc, /tmp and > /lost+found > > I have root access on both servers i create an account on backup server > called backup.rsync -qzaH --exclude=/proc/* --exclude=/tmp/* --exclude=/lost+found/* server:/ /path/to/local/backup Stick that in /etc/cron.daily/ (or as en entry in whatever crontab is appropriate). You probably want to run it as root, so the file ownership and device nodes are preserved. Either run rsyncd on the server (in which case you'd want to change server:/ to rsync://server/modulename) or add backupserver root's public key to root's authorized_keys on server - so ssh won't ask for a password when it runs. If you want archives, well, that's well covered all over the internet, and this list's archives. Probably best to search google and find a method that you like, as it can be done in several ways. --Danny
Danny Sauer wrote:>On Thursday 24 February 2005 09:15 am, you wrote: >... > > >>thanks danny, >> >>but i have a couple of more questions. what port does rsync uses. I >>need to punch a hole in my firewall >> >> > >If you tunnel rsync over ssh, then you just need access to port 22. If you >run an rsync server, you can choose any port, but it runs on 873 by >default. You probably want the ssh route if you're going over the >internet. > > > >>and will this work running it as root >> >>rsync -qzaH --exclude=/proc/* --exclude=/tmp/* --exclude=/lost+found/* >>backup@mcncyo.homeip.net:/luke >> >> >>this is the error message i am getting right now >>rsync -qzaH --exclude=/proc/* --exclude=/tmp/* --exclude=/lost+found/* >>mcncyo.homeip.net:/luke >>rsync error: received SIGUSR1 or SIGINT (code 20) at rsync.c(229) >>-bash-2.05b# rsync -qzaH --exclude=/proc/* --exclude=/tmp/* >>--exclude=/lost+found/* mcncyo.homeip.net:/ /home/backup/luke/ >>ip68-102-244-239.ks.ok.cox.net: Connection timed out >>rsync: connection unexpectedly closed (0 bytes read so far) >>rsync error: error in rsync protocol data stream (code 12) at io.c(165) >> >> > >Stick "-e ssh" in there before the --excludes - you're probably on an old >version that doesn't default to ssh as the transport. > >--Danny > > > > >ok, thanks so far now it seems to do nothing at all rsync -qzaH "-e ssh" --exclude=/proc/* --exclude=/tmp/* --exclude=/lost+found/* backup@mcncyo.homeip.net:/home/backup/luke backup@mcncyo.homeip.net's password: -bash-2.05b# i think i am missing to tell it what to include.