0

I couldn't find any documentation/examples regarding this usage syntax, are we allowed to use @reboot and 23 hours daily in a single command?

I have this cron job schedule to delete my tomcat logs every day 23 hours, now I want this same script need to be run after reboot too. Any suggestions?

0 23 * * * find /tomcat/logs/*.log -mtime +1 -delete

EDIT:

I am not asking about why my cron tab is not working (or) how to work with cron tab, my question is more about can we have command with @reboot as well as hours in single command?

sebix
  • 4,175
  • 2
  • 25
  • 45
kosa
  • 115
  • 2
  • 8
  • 2
    What's wrong with adding another line and replacing 0 23 * * * with @reboot? –  Jul 26 '17 at 03:25
  • @yoonix nothing wrong, I thought one line will solve both purposes if that syntax is supported, otherwise I would end up with 2 lines. – kosa Jul 26 '17 at 03:29
  • Possible duplicate of [Why is my crontab not working, and how can I troubleshoot it?](https://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-it) – Jenny D Jul 26 '17 at 08:27
  • 1
    Keep it simple. Two lines is probably easier to maintain than some exotic syntax hackery few would be familiar with. – Daniel Widrick Jul 26 '17 at 14:17
  • @DanielWidrick Thanks! seems that is what I might end up doing. – kosa Jul 26 '17 at 14:19

0 Answers0