Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added exit on bad crontab #386

Merged

Conversation

Dashboy1998
Copy link
Contributor

Context

  • People have no way of knowing if their cron expressions are bad.

Choices

  • Checking after each addition to the crontab since the test breaks on the first invalid expression
  • Also makes it easier to understand which expression broke as I added

Test instructions

  1. Start the container and should see new section in output
    palworld-server-test  | *****GENERATING CRONTAB*****
    palworld-server-test  | BACKUP_ENABLED=true
    palworld-server-test  | Adding cronjob for auto backups
    palworld-server-test  | AUTO_UPDATE_ENABLED=true
    palworld-server-test  | Adding cronjob for auto updating
    palworld-server-test  | AUTO_REBOOT_ENABLED=true
    palworld-server-test  | Adding cronjob for auto rebooting
    palworld-server-test  | Cronjobs started
    
  2. Start with all cron jobs disabled
    palworld-server-test  | *****GENERATING CRONTAB*****
    palworld-server-test  | No Cronjobs found
    
  3. Try with an invalid cron expression
    palworld-server-test  | *****GENERATING CRONTAB*****
    palworld-server-test  | BACKUP_ENABLED=true
    palworld-server-test  | Adding cronjob for auto backups
    palworld-server-test  | AUTO_UPDATE_ENABLED=true
    palworld-server-test  | Adding cronjob for auto updating
    palworld-server-test  | time="2024-02-13T18:01:54Z" level=fatal msg="bad crontab line: 'FOOBAR bash 
    /usr/local/bin/update' (use -debug for details)"
    palworld-server-test exited with code 0
    

Checklist before requesting a review

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

@thijsvanloef thijsvanloef merged commit f23eaf6 into thijsvanloef:main Feb 14, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants