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

Make cron job parameter configurable #1

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

mmalfertheiner
Copy link
Member

No description provided.

@@ -2,6 +2,7 @@
postgresql_backup:
enabled: false
directory: ''
cron: '30 03 * * *'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexlanz
do I need the quotes here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cron: '30 03 * * *'
time: '30 03 * * *'

You don't need the quotes, but is also no problem if you leave them.

What do you think about giving the property a more specific name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cron is actually more explicit then time.

For example in Spring boot you can schedule jobs and they also name it cron:

@Scheduled(cron = "30 03 * * *")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, works for me

tasks/main.yml Outdated
ansible.builtin.copy:
src: files/postgres
ansible.builtin.template:
src: templates/postgres.j2
dest: /etc/cron.d/postgres
Copy link
Member Author

@mmalfertheiner mmalfertheiner Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexlanz should we give the cron job a more explicit name? postgres-backup?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea

@mmalfertheiner mmalfertheiner merged commit 52e38bb into main Aug 2, 2023
@mmalfertheiner mmalfertheiner deleted the feature/configurable-cron branch August 2, 2023 12:10
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