palworld-server-docker icon indicating copy to clipboard operation
palworld-server-docker copied to clipboard

Add cron command for DockerFile

Open GuillaumeBarreau opened this issue 1 year ago • 1 comments
trafficstars

Context

Setting Up Automatic Backups with Cron

Adding 3 new environment variables to automate the execution of backups on the server."

Environment Variables

DAYS_TO_KEEP:

Description: This environment variable represents the number of days to retain backup files. It is used in the cleanup process to remove backup files older than the specified duration. Example Usage: If set to 7, backup files older than 7 days will be deleted during the cleanup.

BACKUP_CRON_EXPRESSION:

Description: This environment variable defines the cron expression for scheduling automatic backups. It determines when the backup script should run at specific intervals. Example Usage: If set to 0 2 * * *, the backup script will run every day at 2:00 AM.

BACKUP_ENABLED:

Description: This environment variable indicates whether automatic backups are enabled or not. If set to a non-empty value, automatic backups will be enabled; otherwise, they will be disabled. Example Usage: If set to any non-empty string (e.g., true or 1), the backup script will be configured and executed as per the specified cron schedule.

Test instructions

You can try to set up these variables with this value if you want to save backups every minute.

      BACKUP_ENABLED=true
      BACKUP_CRON_EXPRESSION=* * * * *

Checklist before requesting a review

  • [x] I have performed a self-review of my code
  • [x] I've added documentation about this change to the README.
  • [x] I've not introduced breaking changes.

GuillaumeBarreau avatar Jan 25 '24 08:01 GuillaumeBarreau

Thanks for the PR, I will check it once I get home from work!

thijsvanloef avatar Jan 25 '24 09:01 thijsvanloef