Vés al contingut
calbasi.net

Menú

  • Inici
  • Serveis
  • Portfolio
  • Blog
  • Tutorials
  • Contacte
Menú del compte d'usuari
  • Entra

Fil d'ariadna

  1. Inici
  2. Com es fa per...
  3. Drupal
  4. Còpia de seguretat de la web

Drupal backup system

Per joan, 24 maig, 2013

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 "/"
ftp
cron
còpia de seguretat
backup and migrate
backup
Desenvolupament web
Drupal
Gestió empresarial
Drupal 6
Drupal 7
  • Versió per a imprimir

Enllaços relacionats de Drupal backup system

  • Còpia de la base de dades de drupal amb Backup and Migrate
  • Amunt
  • HOWTO: Creació d'un mapa d'establiments a google maps a partir de les adreces d'un full de càlcul

Navegació del llibre

  • Administració de sistemes
  • CiviCRM
  • Correu electrònic
  • Drupal
    • HOWTO: Com substituir taules per DIV des de ckeditor, per usuaris amb rol d'editor
    • Còpia de seguretat de la web
      • Còpia de la base de dades de drupal amb Backup and Migrate
      • Drupal backup system
    • HOWTO: Creació d'un mapa d'establiments a google maps a partir de les adreces d'un full de càlcul
    • External links
    • Llista de correu sobre drupal en català
    • Destacar continguts a la portada
    • Drupal 6
    • Drupal Commerce: mostrar preu al formulari Add to Cart
    • HOWTO: Adding node type class to body element in Drupal 8
    • HOWTO: Com crear alies d'URL als nodes de Drupal 7
    • HOWTO: jump menus in Drupal 8
  • Moodle
  • Calaix de sastre
  • Dolibarr
Canal RSS
Funciona amb