Add periodic cleanup of orphaned drafts: cleanup job, just command, deploy cron

This commit is contained in:
Pontoporeia
2026-06-11 12:23:49 +02:00
parent a19e9e1454
commit 00fed5f0e3
5 changed files with 148 additions and 7 deletions

View File

@@ -0,0 +1,7 @@
# XAMXAM — orphaned draft cleanup cron job
# Installed to /etc/cron.d/xamxam-cleanup (system cron format: minute hour dom month dow user command)
#
# Deletes draft theses older than 24h that have no attached files.
# Runs every 4 hours — drafts only become eligible after 24h, so this is ample.
# The script is a dry-run unless --no-dry-run is passed.
0 */4 * * * www-data php /var/www/xamxam/scripts/cleanup-drafts.php --no-dry-run >> /var/log/xamxam-cleanup.log 2>&1