run a cron every second day
Hi guy's
I've been searching a procedure on how can I run a command every 11:59 midnight every in every 2nd day interval. sample today is monday it will run on 11:59 pm and the run will be tuesday of 11:59 pm. I've been looking for samples in google but I havent found any. just hourly, daily, weekly and monthly schedules. Thanks in advance |
Quote:
Here is an example site for you - cronjob exmpales. Now you can try with the help of those examples by understing cron and cronjob. |
maybe run it every 48 hour? see http://www.adminschoice.com/crontab-quick-reference
and I'm just assuming you mean monday and wednesday? |
I also found this: http://www.absolutewillynilly.com/we...ob-run-2-days/
|
There is also a trick to let the cronjob store the unix time in seconds after a completed job in a timestamp log file just let it run each day and If the difference is less than 172000 seconds you let it skip the job not updating the timestamp file. And If it is greater than 172000 you let it run and overwrite the timestamp log with a new one
|
Why not just:
Code:
.---------------- minute (0 - 59) |
With a timestamp based script it doesn't care if you restarted the machine.
Added an example script for desktop usage for running a backup job each 48 hours even if you don't use the computer for 3 days it will take action on that thirth day. This script just needs to be called by cron.daily skip_a_day.cron.sh.tar.gz |
with the every second day */2 option in crontab it shouldn't be hard to do either
|
Quote:
|
All times are GMT -5. The time now is 08:19 PM. |