"ultimate" backup choice
David Fletcher
dave at thefletchers.net
Sat Dec 11 14:24:33 UTC 2010
On Sat, 2010-12-11 at 04:17 -0800, S Mathias wrote:
> i have:
> "SERVER A"
> "SERVER B"
>
> with "full root permisson" [ssh, etc]
>
> each server has a folder.
>
> i want to backup a folder in "SERVER A".
>
> are there any backup methods, that meets these two requirements? :
>
>
> 1) running from e.g.: a cronjob
>
> 2) when running, it just checks the folder in "SERVER A" and "SERVER
> B". if a file/folder has been added/removed/modified in the "SERVER
> A"'s folder, then it copies/removes it/them to "SERVER B"'s folder.
>
> please help!
>
> Thank you in advance! [for any links, howtos :\ ]
>
> have a nice weekend
>
Sounds like you want a script something like this on your SERVERB (I
keep mine in /home/ but it's entirely up to you):-
#! /bin/bash
# server /home directory
# Make sure it's alive and kicking first!
if ping -c1 -w2 SERVERA </dev/null &>/dev/null
then
# In between then and fi is a single line
sudo -u billg rsync -av --delete --bwlimit=3000
root at SERVERA:/home/ /home/billg/backups/server/copyofslashhome/
fi
with something like this line:-
41 * * * * root /home/BackupServerWithCron
added to your /etc/crontab. Works for me.
You'll also need to add billg's public ssh key
to /root/.ssh/authorized_keys on SERVERA to get this to happen without
manually entering a password.
Dave
More information about the ubuntu-users
mailing list