Approximately once a week, there's updates in needs to run every 10 minutes instead of every 1 day.
Is the day these updates need to run dependent on an external condition or is it a predetermined (albeit semiperiodic) time? What's the condition for stopping the scheduled jobs?
If you need to run a few of the 10 minute updates,
at might be the simplest way to go.
If you know ahead of time when the updates will run (that is, the time isn't dependent on an external factor), you could write a more complex schedule for the updates cron entry. You might need to write multiple entries. For example,
Code:
[FONT="Courier New"]# Run updates every 10 minutes on even hours on the 4th and 18th,
# and on odd hours in the morning and evening on the 12th and 26th
*/10 */2 4,18 * * updates
*/10 1-7/2,21-23/2 12,26 * * updates[/FONT]
I believe all modern crons (according to the manpage, absolut runs ISC Cron V4.1; ISC is the newer name for Vixie cron) support lists of ranges and range steps, but I could be wrong.
If that won't work, you can:
- use crontab -l to get your current crontab,
- add (or uncomment & alter) a line for the updates,
- save that to a file $crontab,
- then run crontab $crontab to install the crontab with the update script scheduled.
To disable the update script, do basically the same thing but comment out the line for the scheduled update script in step 2. This approach is error prone, which is why a complex schedule is better than updating crontab. If you must use the last approach, add numerous sanity checks: when you schedule the update script, run it only on the current day and have the update script double check that it should run.