Drupal (Auto) Update mit Shell Script & Cronjobs

Submitted by Gast (nicht überprüft) on Mi, 01/20/2021 - 03:17
  1. Create : drupal_backup_update.sh
     
  2. Cronjob (Drupal Update every day at 03:15):
    15 3 * * * /path/to/drupal_backup_update.sh
  3. chmod +x drupal_backup_update.sh

 

drupal_backup_update.sh :

#!/usr/bin/sh

echo " DRUPAL UPDATE START "

date

cd /html/drupal

drush version

composer self-update --1

composer update drush/drush

composer update --dry-run

drush cr

tar -zcf /backup/web-$(date +%Y-%m-%d-%H%M).tar.gz /html/drupal

drush cr

drush sql:dump  | gzip -c > /backup/db-$(date +%Y-%m-%d-%H%M).sql.gz

drush state:set system.maintenance_mode 1 --input-format=integer

composer update

drush updb -y

drush state:set system.maintenance_mode 0 --input-format=integer

drush cr

date

echo " DRUPAL UPDATE END "

 

Neuen Kommentar schreiben

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.