Execute crontab for every 4 hours and begin from current time
I want to add a crontab entry which should execute for every 4 hours and that 4 hours calculation should begin from the current time.
Normally if I set the crontab entry like this,
The above will execute the date command for every 4 hours like 4,8,12,16,20,24 on 30th May, for example I start the crontab at 02:00:00. But if I start the crontab at 09:15:00, it should execute the crontab command after 4 hours like 13:15:00, then 17:15:00 like this.
Can any one please tell me, how to achieve this in crontab ?
You can setup cron to run @ specific start time only and use something like this :
With yourjob.sh :
You shouldn't loose to much seconds and it will run 9.15, 13.15, 17.15,21.15
Hello all,
How can I find out the start and end of the writing file in the directory or recording time for writing file?
I have a directory where small ~ 1*MB temporary files are written.
After the end of the record, they are retrieved and erased.
I can only find out that the files are... (4 Replies)
Hi ,
We have around 22 logs , each has different entries. I have to automate this using shell script. The ideas which am sharing is given below
1) We use only TAIL -100 <location and name of the log> Command to check the logs.
2) We want to check whether the log was updated before 24... (13 Replies)
Hi,
I want to add some hours and minutes to the current date. For example, if the current date is "July 16, 2012 15:20", i want to add 5 hours 30 minutes to "July 16, 2012 00:00" not to "July 16, 2012 15:20". Please help.
Thanks! (4 Replies)
Hi All
I have a problem, I wonder if you can help me sort it out:
I have the following entry in the cron:
00 1,13 * * * /home/report/opn_amt_gestores_credito.ksh > opn_amt_gestores_credito.log
But the entry only runs at 01:07
I have stopped the cron deamon, and started, but it still... (39 Replies)
This is a new one on me. We upgraded a system from AIX 5.3 TL 7 to 6.1 TL 7 yesterday. The app people notified us that their cron jobs weren't running at the right time. So I made a test cron entry and here's what I've found:
# crontab -l
* * * * * /usr/bin/date > /tmp/test.log 2>&1
# cat... (2 Replies)
Hi,
Time till when the application should run is indicated in a file. First line is hour and second line is minute.
file:
10
55
Means my application should run till 10:55.
Now in a shell script, i am trying to make that logic but with no luck.
min=`tail -n 1 /file_with_time`... (1 Reply)
Hi Experts,
I want to run a script which will move the files from particular directory to another backup directory After EVERY 5 hour.
How can I put it in crontab-
5 hours!!! * * * * /home/movefilescritp.sh
//purple (8 Replies)
can someone please check my answers for the crontabs I am making
1. how would I set up a crontab tab executes every 2 minutes each and every day of the week?
answer: 2 * * * * /path/to/file.pl <-- is this correct?
2. how would I set up a crontab that executes every 24 hours at 2am?... (6 Replies)
I want to schedule a batch job (SQL)to run every 6 hours in Unix and the AT command syntax does not seem to cover this.
I have created a file ncd_rpt in the directory report and have given the command in this file.
at -f /report/ncd_rpt 1:00 am tomorrow
I schedule this by running
sh... (1 Reply)