Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a suitable backup automation script that will run in PHP on my apache server.

Some of my sites run Drupal. Which is the most suitable method to automatically backup both the code and the database?

share|improve this question
You really don't want to try to do this from within the webserver: Most have a 5-minute request timeout, and a backup of a large site could take way more than that. Something scheduled out of cron would be better. – voretaq7 Jan 26 '11 at 19:35

You should consider using tar in a daily script for your websites, and for the database, just dump it:

mysqldump -u USER -p DATABASE > filename.sql
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.