-
Notifications
You must be signed in to change notification settings - Fork 222
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
Allow cron to update existing cron entries #1328
Comments
It seems the issue templates were ignored while reporting this one, but I believe it is safe to assume this is a feature request :)
Yes, and I agree that a similar way to attach "identifiers" for cronjobs would be nice to have in Rex as well. Since they are comments, there wouldn't be too big implementational differences depending on the available crontab provider.
The Based on that initial details, I think it would be enough to target the implementation of |
To make upgrading easier, it would make sense to have it fall back to the exact entry for cron jobs if the comment was not found. |
It took me a while to figure out what you might mean by that exactly, but I believe it's this: "if there's already a cronjob that is an exact match for the timing and the command, just add the comment for it". Is that correct? |
Yes. |
To change a cron entry, it first needs to be marked absent, changed, and then re-run.
What Ansible and Puppet do is prepend a comment that they use to identify the cron job by resource name, so that changes can be updated.
Perhaps the way to implement this is to provide an optional "update" (boolean) argument to cron_entry (or cron_add). If the update argument is true, then it looks for a line with "Rex: " + resource name rather than the exact cron job.
The text was updated successfully, but these errors were encountered: