BASH backup script

Any other programming language that is not covered in the Web Scripting category.

BASH backup script

Postby nene on Mon Jan 23, 2006 7:35 pm

I am a part of a non-profit communitiy that owns two home servers on different locations... I would like to backup some directories from one server to another and vice-versa. The script should be automated, so therefore using RSA private keys and would be added into crontab. Does anyone have such a script or something similar? i googled, got some results but the scripts didnt suit my needs... Anyway, any help regarding this would come handy... I also have to read how exactly do RSA private keys work... Can somebody give me short, quick explanation?

Thanks
Image
nene
Regular
Regular
 
Posts: 128
Joined: Wed Apr 13, 2005 10:24 am
Location: Slovenia

Postby ravenhair on Tue Jan 24, 2006 12:47 am

just use rsync with the ssh option.

or if you just want to run a copy scp.

Put them in cron and your done. I mean what exactly are you trying to do?

Keep directories in sync?

tar and copy file's?
ravenhair
Regular
Regular
 
Posts: 80
Joined: Tue Nov 08, 2005 5:51 pm

Postby nene on Tue Jan 24, 2006 8:49 am

as i said, we have 2 servers... now both host some webpages... now, i would like backup these webpages from one server to another, so if i disk brokes i have the data on the other server... i hope i made it clear...

what is rsync?
Image
nene
Regular
Regular
 
Posts: 128
Joined: Wed Apr 13, 2005 10:24 am
Location: Slovenia

Postby ravenhair on Tue Jan 24, 2006 4:02 pm

rsync is an open source utility that provides fast incremental file transfer. rsync is freely available under the GNU General Public License version 2 and is currently being maintained by Wayne Davison.

ssh keys explanation:
http://hacks.oreilly.com/pub/h/66

A good way will be to setup a cron job and use rsync to only transfer the files that have changed beetween the servers.

setup a backup directory on each machine to hold the data for the other:

ex:

rsync -az -e ssh --delete /var/www/html remoteserver:"/var/www/html/server_backup"
[/url]
ravenhair
Regular
Regular
 
Posts: 80
Joined: Tue Nov 08, 2005 5:51 pm

Postby nene on Thu Jan 26, 2006 10:44 am

ok, thanks ravenhair, i'll try it and post the results...
Image
nene
Regular
Regular
 
Posts: 128
Joined: Wed Apr 13, 2005 10:24 am
Location: Slovenia

Postby kotuk on Sun Apr 16, 2006 10:47 am

Hey,
what about autmated script for sending maisl with attachment? (backup porporuses)
thanks
kotuk
Contributer
Contributer
 
Posts: 24
Joined: Sat Apr 15, 2006 7:42 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron