manage-client.cron 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. # Backup and update client — crontab lines for this installation.
  2. #
  3. # Adjust the two paths, then add them with `crontab -e`, or paste them into the
  4. # hosting panel's cron form. Check the PHP binary with `which php`; shared hosts
  5. # often want a versioned one such as /usr/bin/php8.2.
  6. #
  7. # --quiet suppresses normal output. Errors still go to STDERR, and cron mails
  8. # those to MAILTO — which is the whole point of running it this way.
  9. MAILTO=admin@example.org
  10. PHP=/usr/bin/php
  11. SITE=/var/www/html/foto-portfolio
  12. # Nightly backup at 03:20: data/ and media/, uploaded to the manage server.
  13. # Runs at night because it archives every locally hosted image.
  14. 20 3 * * * $PHP $SITE/manage-client/bin/manage-client.php backup --trigger=cron --quiet
  15. # Hourly status report: version, PHP version, free disk space, last backup.
  16. 7 * * * * $PHP $SITE/manage-client/bin/manage-client.php heartbeat --quiet
  17. # Update check on weekday mornings. Exit code 2 means "update available"; cron
  18. # reports a non-zero exit as mail, which is exactly the notification wanted.
  19. 0 8 * * 1-5 $PHP $SITE/manage-client/bin/manage-client.php check --quiet
  20. # Updates are deliberately not installed here. `update` overwrites files while
  21. # the site is live, has no rollback, and may run migrations — that belongs in
  22. # front of a human, at Admin -> Maintenance.
  23. #
  24. # Without cron at all: set MANAGE_BACKUP_AUTO_INTERVAL_SECONDS in
  25. # manage-client/config.php to 604800, and the admin dashboard makes the weekly
  26. # backup itself the next time it is opened.