- Create : drupal_backup_update.sh
- Cronjob (Drupal Update every day at 03:15):
15 3 * * * /path/to/drupal_backup_update.sh
-
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