Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
What would be the cron expression for "nth second of every minute"?
For example, for every 5th second of every minute, the cron would run at 1:00:05, 1:01:05, 1:02:05 and so on.. 24x7.
I could not find any documentation for achieving this.
Thanks in advance!
This functionality is not available out of the box. What you could do is prepend your command with sleep, so it would be:
sleep 5 && /app/script.sh
Figured it out. The cron expression would be.
5 * 0 ? * *
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I don't have a box to test a cron job so I am posting it here.
I want to run a job every hour between 6 am to 18:00.This is what I have tried
0 6-18/1 * * * <command>
and
0 6-18 * * * <command>
Which one is the correct way of achieving it
Both should work, but I would probably use the second one.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I want to use the command "at" to schedule a job to run at one second (or minute/hour) later. If using "-t" option, then it involves with the hassle of getting the current time etc. Is there any easy way out?
But don't suggest me to use "sleep", because the current process will exit.
Thanks for the tip.
The at program can take now+ a time unit (e.g. now+1minute) as a timespec. You won't get finer time resolution than one minute with at.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I would like a cronjob that runs every 5min with the condition that it doesn't start at time 0.
Current schedule is:
*/5 * * * *
However, this will kick off the script at 00:00. I need something like (5-60)/5 * * * *
Thanks!
I'm not sure there is a way to do this in cron. You might be better off leaving the schedule as is, and checking the time in the beginning of your script, and using a condition to exit the script if it is not supposed to run at that time.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have a cronjob set to run as
3 6 10 * 1-6 wget'http://...'
How will this execute ? I intend to run it at 6:03 AM on the 10th Of Every Month expect on Sundays.
I am confused as it ran on Saturday, even when the date was not 10th.
Please advise if there is an error with my command or could it be something else ?
The way you have this setup, your command will execute EITHER when the day of the week is 1-6 OR when the day of month is 10.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
How can I automatically restart my node js server every 4 hours automatically. There is a bug that only shows up after 4 hours and I want to be able to run it through the night.
I'm already using forever.
Thanks,
Arjun
It doesn't sound like you're really solving the problem... But you could use a crob job.
Something like:
0 */4 * * * forever restart <MYSCRIPT.JS>