LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-20-2006, 04:01 AM   #1
keyF
Member
 
Registered: Jan 2006
Location: Moscow
Distribution: Debian, RHEL, FreeBSD, CentOS
Posts: 38

Rep: Reputation: 15
remote backup of th web server


Hello,

i'm writing and implementing backup policy in my company and i need some advice..

I have web server (linux+apache+php+mysql) which i need to backup on a regular basis.

the following is my thoughts about this process:

write a script which will run on the web server and make a dump of mysql databases and a tar with web content. after archiving this script will rsync resulting archives to another server (let's call it backup server).

I want to run this script remotely from backup server thru ssh:

backup-server$ ssh backup@web-server /backup/do-backup.sh

user "backup" authenticating on web-server with a key (not a password).. how do I make this process more secure? is there some things that i should consider?
another thing: i don't want backup process to disturb my web-server, how can I run backup script with lower process priority?
and the last goal which I want to accomplish: traffic minimization. I know that rsync can transfer only changed parts of file (i've tested it on text files) does it belongs to bz2 archives too? is there any special parameters which i must to use?

thanks
 
Old 09-20-2006, 05:15 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
If you want to make it more secure, you can limit by hostname or IP for ssh keys, so it won't ask for a password but it's only going to allow that host to login with correct ssh keys.

If you want to take advantage of rsync's capabilities of only grabbing new edited or updates files, I would suggest not tar or gzipping them up and just run rsync from the backup machine to grab files you want backed up.

Perhaps a scenerio like this would work for an incremental and full backup plan:

1. rsync pulls files from webserver on say Sunday, this would be the first and full backup of the files you want.
2. Monday thru Saturday, you do the same thing but rsync should only pull updated files. But on Saturday after the files are pulled down, archive them and or gzip them up then, place on another location and keep for another period of retention of your choosing, perhaps keep a few weeks of gzipped files.
3. Sunday comes around and it does another full backup and the process starts all over.

rsync has a compression option I believe, so you can compress when transferring. The only downside to this quick setup in my head would be you could only go back to the previous day if you lost a file, couldn't go back several days if someone made a bad configuration or change to a file. But you could get creative and this should give you some type of idea.
 
Old 09-20-2006, 05:53 AM   #3
keyF
Member
 
Registered: Jan 2006
Location: Moscow
Distribution: Debian, RHEL, FreeBSD, CentOS
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by trickykid
If you want to make it more secure, you can limit by hostname or IP for ssh keys, so it won't ask for a password but it's only going to allow that host to login with correct ssh keys.
i have
Code:
PasswordAuthentication NO
in my sshd.conf, so users without keys will be dropped (and they really are).
And also I have firewall on my web-server which accepts connections to 22 port only from my office IP.
Is there any method to link user's key to some IP address? i.e. allow login using this key only from given IP address?

Quote:
If you want to take advantage of rsync's capabilities of only grabbing new edited or updates files, I would suggest not tar or gzipping them up and just run rsync from the backup machine to grab files you want backed up.
so, rsync cannot take only updated parts of gzpped file?
Quote:
Perhaps a scenerio like this would work for an incremental and full backup plan:

[skip]

The only downside to this quick setup in my head would be you could only go back to the previous day if you lost a file, couldn't go back several days if someone made a bad configuration or change to a file. But you could get creative and this should give you some type of idea.
i'm currently using the followint scheme:
1. backup content rsync'ed daily to backup server in some folder. "latest" for examle
2. after rsync, "latest" is tarred and gzipped to a file with name like backup-yyyymmdd.tar.gz which is stored in some other folder like "archives"
3. and the last step should be cleanup: delete archives which are too old (two weeks ago in my case).

in my example i can restore any file at any given date inside those two weeks. and i don't need to waste bandwidth for full backup once in a week.
what do you think about my scenario?
 
Old 03-26-2007, 07:55 PM   #4
rollytan
LQ Newbie
 
Registered: Mar 2007
Posts: 2

Rep: Reputation: 0
Id recommend a developed linux/mysql backup agent.

try http://www.disksave.com They have both and email you daily on success or failuer and reason.

nice package
 
  


Reply

Tags
backup, ssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web server backup and failover panicbox Linux - Networking 4 08-29-2006 01:56 AM
LXer: Backup MySQL databases, web server files to a FTP server automatically LXer Syndicated Linux News 0 08-11-2006 09:54 PM
Backup exclusions for RedHat 7.3 Web server? Tenover Linux - General 7 01-31-2006 10:29 PM
Remote, automated backup: Windows --> Linux server hamish Linux - Software 1 12-07-2004 10:46 AM
Best way to backup to a Remote Snap Server kemplej Linux - Networking 1 08-31-2004 04:16 PM


All times are GMT -5. The time now is 02:17 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration