Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cronjob every 25 hours?

Tags:

cron

How do I set up a cronjob that runs every 25th hour?

like image 638
Timmy Avatar asked Sep 13 '09 07:09

Timmy


Video Answer


2 Answers

Just a guess, but you don't

Best hack off the top of my head: write a script to track the last time it was run, and conditionally run it if it was more than 25 hours ago.

Cron that driver script to run every hour.

like image 193
timdev Avatar answered Jan 04 '23 11:01

timdev


It would be easier to issue an at command specifying the time and date of the next job when you start the current one but you could simulate that with a cronjob by updating the cronjob entry for the process at the start of the current run (not at the end 'cos then you'd have to take into account the time to run the job).

like image 23
mas Avatar answered Jan 04 '23 11:01

mas