Backing up Linux to a remote server!
For 3 hours im searching for this answer and came across this website. Which Im glad to cause im a newb to linux and prefer it over any O/S so I might frequent this board a lot.
Dont flame me as I dont really know where to post this since Im new here Here is what i'm looking for... I want to backup the entire server, onto another server. Files, Configurations, Email, SQL Databases, EVERYTHING basically take an image of the current drive, and upload it to another server. My client asked me if I could make a script that would do just this but he wants it to shut down current processes, create an archive of the backup, taring and gziping everything, so when you unzip, it would unzip back to its original state, and upload it to a remote server, and set this up as a cron job. I think he's asked the impossible as I cant really think of a way to make a shell script that would disable any current processes, and start the backup. The archive used for backup, id prefer tar.gz Any help would be SOO greatly appreciated as Im exhausted looking for the answer. |
mkdir /backup
mount 192.168.0.1:/share /backup cd / tar czvf /backup/slacker-12-10-02.tar.gz . --exclude backup --exclude proc --exclude tmp |
Quote:
Quote:
Im looking at this script right now that might do the trick but im very leary of it.. think it will work?? PHP Code:
|
the mount command would mount an nfs share on the computer that you are putting the backup on
if it's a MS windows machine you could change that to mount a windows share the tar command will backup the entire system to the computers hard drive that you mounted with the exception of the backup folder itself, the proc folder, and the tmp folder you do not backup a proc folder because it is dynamic, however you do need the empty folder there if you restore a system I guess you could use --exclude proc/* so the folder would be in the backup you could also do the same with the tmp folder or just backup the whole tmp folder if you want. |
I think that it would not be a bad idea to backup the database with that script or one like it before running the tar backup
the script may not work exactly as is it depends on your database name and location |
you can unmount the share after the backup finishes using this
umount /backup |
All times are GMT -5. The time now is 05:20 PM. |