Forum Moderators: coopster

Message Too Old, No Replies

PHP MySQL website backup

I want to automate the site backup process

         

wildeyedfrank

5:56 pm on Mar 26, 2005 (gmt 0)

10+ Year Member



Gentlemen/Ladies -
I've been trying to solve this problem on and off for 2 or 3 weeks.

I've found tantalizing scripts that purport to do exactly what I want (daily DB, weekly website backups) However, through may lack of familiarity with perl and **nix Each one has failed.

Is there a way to use a PHP script to compress the entire website (and the dB on a seperate occasion) into a tar.gz? The zlib functions seem to be for zipping individual files. I can see FTP functions in PHP that should make executing the move. Creating the file seems to be the hard part.

Or is there a way to execute the **nix command line looking stuff from the middle of a PHP script?

Naturally the web-host guys know less than I do about this stuff (comforting). But I can schedule cron jobs and have been successful pointing at a file (which just gives me an error).

I hope this is clear enough.

ergophobe

6:19 pm on Mar 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you can run a cron job, you should be able to

- create a tarball of the entire website
- do a mysql dump

You could set it up to just overwrite the backup each time or to create an archive by date. Is that the sort of thing you're looking to do?

wildeyedfrank

6:59 pm on Mar 26, 2005 (gmt 0)

10+ Year Member



That is exactly what I want to do...I'd opt for the archive so I'd have a few days of mysql, and 2-3 weekly backups of the site itself.

Any help you can offer would be much appreciated.

I have another domain hosted on the other side of the country that I want to post the backups to.

Then I can go create a second layer of reassurance by showing my client (mom) how to dump that to CD occasionally.