Drupal backup system

Hi,
I want to offer my customers the option of backup their drupal locally. I developed a system based in Backup and Migrate module and some work at server side... I'd like to share with you my work, to receive your feedback, opinions, improvements... if you think it could be useful ;-)

Install Backup and Migrate drupal module

Schedule suggestion: weekly and 3 month copies, keeping last 12 in both categories.
Thus, we are going to keep copies from last 3 years.

In Cpanel, add a new ftp account with these details:

  • user: web_backup
  • password: (your choice)
  • Directory: DRUPAL_BASE_DIRECTORY/web_backup
  • quote: your choice (ex 200MB)

At server DRUPAL_BASE_DIRECTORY, as root:

# chmod 700 web_backup
# nano web_backup_info.txt

Put here any useful info and save the file

# nano web_backup.sh

And, there:

Drupal_Path="/home/calbasi/www/web"
tar cf $Drupal_Path"/web_backup/web_backup_sites.tar" $Drupal_Path"/sites/default/settings.php"
gzip -f $Drupal_Path"/web_backup/web_backup_sites.tar"
_now=$(date +"%Y_%m_%d")
cat $Drupal_Path"/web_backup_info.txt" > $Drupal_Path"/web_backup/LastBackupDate_$_now.txt"
mail -s "EMAIL_SUBJECT" "EMAIL_TO_ADDRESS" <<EOF
EMAIL_BODY (IN SEVERAL LINES)
...
EOF

Then, we add a cron task:

# crontab -e

There, insert a line like this:

0 4 23 * * DRUPAL_BASE_DIRECTORY/web_backup.sh

In the example, you get a backup monthly, the 23th day, at 04:00

TODO:

  • force ftp secure connexions
  • solve tar warning "/"

Afegeix un nou comentari

Text pla

  • No es permet l'ús d'etiquetes HTML.
  • Les línies i paràgrafs es trenquen automàticament.
  • Les adreces web i de correu electrònic es transformen en enllaços automàticament.