# Backup and update client — cron for installations that have it. # # Cron is OPTIONAL here. This host is assumed not to have it, so the backoffice # drives the schedule itself: any admin page load past the interval starts the # backup in the background (see app/manage.php). Everything below is the same # work on a dependable timer instead — set it up if the host offers cron, and # the web fallback simply never finds anything due. # # Two ways, pick one. MAILTO=admin@example.org # --- A. Over the web (no shell needed; works on hosts whose "cron" is really # --- just a URL fetcher). The key lives in data/worker-key.json. # # Runs whatever is due: the weekly backup, the hourly heartbeat. Never updates. */15 * * * * curl -s -m 10 "https://www.example.com/manage-worker.php?key=YOUR_WORKER_KEY" >/dev/null # --- B. Over the shell, with the CLI. Same jobs, explicit schedule. # # Check the PHP binary with `which php`; shared hosts often want a versioned # one such as /usr/bin/php8.2. --quiet suppresses normal output — errors still # go to STDERR, and cron mails those to MAILTO, which is the point. PHP=/usr/bin/php SITE=/var/www/html/foto-portfolio # Nightly backup at 03:20: data/ and media/, uploaded to the manage server. # Runs at night because it archives every locally hosted image. 20 3 * * * $PHP $SITE/manage-client/bin/manage-client.php backup --trigger=cron --quiet # Hourly status report: version, PHP version, free disk space, last backup. 7 * * * * $PHP $SITE/manage-client/bin/manage-client.php heartbeat --quiet # Update check on weekday mornings. Exit code 2 means "update available"; cron # reports a non-zero exit as mail, which is exactly the notification wanted. # The backoffice checks on its own when the Maintenance page is opened, so this # line is only worth having if you want to be told without looking. 0 8 * * 1-5 $PHP $SITE/manage-client/bin/manage-client.php check --quiet # Updates are deliberately not installed by either variant. `update` overwrites # files while the site is live, has no rollback, and may run migrations — that # belongs in front of a human, at Admin -> Maintenance.