Files
timebank-cc-public/scripts/cron-backup.conf
Ronald Huynen 2547717edb Initial commit
2026-03-23 21:37:59 +01:00

70 lines
2.8 KiB
Plaintext

# Laravel Timebank Backup Cron Configuration
# Copy this file and customize for your server setup
# To install:
# 1. Edit paths and email addresses
# 2. Copy to /etc/cron.d/timebank-backup (requires root)
# OR add entries to user crontab: crontab -e
# Set PATH and environment variables for cron (UPDATE THIS EMAIL)
PATH=/usr/local/bin:/usr/bin:/bin
MAILTO=admin@yourdomain.org
# Timebank project directory (UPDATE THIS PATH)
PROJECT_DIR=/var/www/timebank_cc
# Daily backup at 2:00 AM every day
0 2 * * * root cd $PROJECT_DIR && ./scripts/backup-all.sh daily --verify --notify >> /var/log/timebank-backup.log 2>&1
# Weekly backup at 3:00 AM every Sunday (includes full storage backup)
0 3 * * 0 root cd $PROJECT_DIR && ./scripts/backup-all.sh weekly --verify --notify >> /var/log/timebank-backup.log 2>&1
# Monthly backup at 4:00 AM on the 1st of each month
0 4 1 * * root cd $PROJECT_DIR && ./scripts/backup-all.sh monthly --verify --notify >> /var/log/timebank-backup.log 2>&1
# Full storage backup every Sunday at 5:00 AM (additional full backup)
0 5 * * 0 root cd $PROJECT_DIR && ./scripts/backup-storage.sh full >> /var/log/timebank-backup.log 2>&1
# Cleanup and health check every day at 6:00 AM
0 6 * * * root cd $PROJECT_DIR && ./scripts/cleanup-backups.sh >> /var/log/timebank-backup.log 2>&1
# Log rotation for backup logs (optional)
# 0 7 * * 0 root /usr/sbin/logrotate -f /etc/logrotate.d/timebank-backup
###############################################################################
# Alternative User Crontab Entries (if not using system cron)
# Run: crontab -e
# Then add these lines (adjust paths as needed):
###############################################################################
# # Daily backup at 2:00 AM
# 0 2 * * * cd /home/r/Websites/timebank_cc_2 && ./scripts/backup-all.sh daily --verify --notify
# # Weekly backup at 3:00 AM every Sunday
# 0 3 * * 0 cd /home/r/Websites/timebank_cc_2 && ./scripts/backup-all.sh weekly --verify --notify
# # Monthly backup at 4:00 AM on the 1st of each month
# 0 4 1 * * cd /home/r/Websites/timebank_cc_2 && ./scripts/backup-all.sh monthly --verify --notify
###############################################################################
# Cron Schedule Reference
###############################################################################
# Format: minute hour day_of_month month day_of_week command
#
# minute (0-59)
# hour (0-23)
# day_of_month (1-31)
# month (1-12)
# day_of_week (0-7, where 0 and 7 are Sunday)
#
# Special characters:
# * = any value
# , = list separator (e.g., 1,3,5)
# - = range (e.g., 1-5)
# / = step values (e.g., */5 = every 5)
#
# Examples:
# 0 2 * * * = Every day at 2:00 AM
# 0 */6 * * * = Every 6 hours
# 30 1 * * 0 = Every Sunday at 1:30 AM
# 0 0 1 * * = First day of every month at midnight
###############################################################################