Wow that was annoying, I wrote a huge long entire post out, clicked submit and the damn thing lost my entire post.
Ok, here's what I am needing to do.
Have a cron job run every six days at a random minute and hour ONLY ONCE on that day.
Would this work?
Something like that, should work in theory right? The above should in theory, count six days, then on the sixth day, wait until 3:30am then run the command. At which point it should then count six days, and also be counting every 30 minutes and every 3 hours, right? So the next time the sixth day comes around, the command would run at a completely different time of that day, right?
eg:
6.40am
9.50pm
12.10pm
5.20am
Does that make sense? I know I can do it in PHP but I would rather try do it this way, to avoid being forced to run things too heavily.
The */6 part, that'll work. But the minutes and the hours part. Will that work as I think it should, or will it only begin counting from the beginning each time? Resulting in the time the job runs, always being the same and ending up being no different to just using 30 3 * * */6 command? Which of course isn't what I want.
@ thegeek
Yeah, you pretty much confirmed what I was afraid of. Lucky I didn't test it haha ouch.
@ Scrutinizer
Yeah, looks like I'll probably have to do something like that. I'm pretty sure I'm limited to creating new jobs via the cpanel in my case, but thinking I could setup two simple jobs, one to run a php script to generate a random time and store that somewhere as a string, then a second that runs more often which would only do something if a result matched the first generated time, using a simple if statement. That would make sure it only ran the every few days (via cron), and then only once at a random time.
Thanks for your help guys!
P.S. I suppose thinking about it, if the cron settings did work how I thought in my first post, it would ruin about 90% of everyone elses setups in the world wouldn't it.
Hi,
I have a cron job that I want to run twice a week, on Tues/Thurs, and I want it to run three times - specifically at 10pm, 11:10pm, and 12:20am respectively.
I "think" the way to do this is to run the following:
00,10,20 22,23,00 * * 2,4 MYCOMMAND
Just wanted to verify this... (4 Replies)
Hi,
1)
If some job supposed to run on 1st of every month at 7 AM
In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day?
2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct)
And if 25th... (5 Replies)
Hi ,
I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility )
I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Now I have a list of numbers in hand and I try to put the numbers into two columns. Can I do this work with any script? Great thanks to your help!
1A1.log
HF=-240.451527
HF=-240.5213996
1A2.log
HF=-240.451527
HF=-240.5213996
1B.log
HF=-240.4273718
HF=-240.4956636
1C.log... (7 Replies)
Hi,
How to monitor whether a cron job is running or errored out..?other than checking the process using ps-aef
how to enter the cron job which throws the output in 1 file and errors in other file. i remember it can be done using >1 and >2 ..but not sure..
any expert..please help!! (1 Reply)
I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Hi All ,
We have few scripts which uses common environment/path setting variables.
Now instead of putting classpath , framework,java_home ..... etc. in all the script, can we make a file with all common settings which can be envoked by the scripts while running. If yes , say setting file is... (3 Replies)