Please provide entry..

Log file generated on the basis of dates..

link|improve this question
3  
Please read about the structure of crontab entries: en.wikipedia.org/wiki/Crontab#Examples .. information available in the Internet. – Felix Sep 14 '10 at 7:21
feedback

migrated from stackoverflow.com Sep 15 '10 at 0:45

This question came from our site for professional and enthusiast programmers.

2 Answers

0 0 * * *  

0 0 * * * your_command_goes_here
| | | | |
| | | | +- every year
| | | +--- every month
| | +----- every day
| +------- 0th hour of the day.[hour = 0 ]
+--------- Top of the hour [minutes = 0].

The interpretation of cron expression may differ from the implementation here it is for the linux cron .
If you didn't expecting it then be specific.

link|improve this answer
Interestingly enough, that's one of my previous answers you "lifted" that table from :-) I recognise it since the OP was confused about my "top of the hour" text and I'm one of the few here specialising in ASCII art. Don't worry, feel free to use it, I won't be miffed. – paxdiablo Sep 14 '10 at 7:31
yeah i copied it from there :p – Jigar Joshi Sep 14 '10 at 7:38
feedback
0 0 * * * your_command_goes_here

is how you do it. Midnight is basically 00:00 and the date you get from date will be the new date, not the old.

If you want the older date, just start at 11:59, get the date straight away, then sleep for 61 seconds:

59 23 * * * your_command_with_a_60_second_delay_goes_here

That's probably easier than trying to worry about date calculations. I'm nothing if not sneaky :-)

link|improve this answer
does 0 means 12? m confused coz i thought it should be like 0 24 * * * or 0 23 * * * ..what are diff..thanks for quick reply – Rupali Sep 14 '10 at 7:27
The first 0 means zero minutes past the hour. The second 0 means the hour of midnight. 0 23 ... will give you 11pm. 0 24 ... may or may not work depending on your cron implementation. – paxdiablo Sep 14 '10 at 7:28
@Rupali: Time most often goes from 00:00 to 23:59 in 24h format. Logically, 24:00 would be 00:00. – Felix Sep 14 '10 at 7:29
okie...0 0 * * * will work in solaries? – Rupali Sep 14 '10 at 7:31
Yes, it will work with Solaris. – paxdiablo Sep 14 '10 at 7:33
feedback

Your Answer

 
or
required, but never shown