👤
Home Man
Search
Today's Posts
Register

If you're not sure where to post a Unix or Linux question, post it here. All unix and Linux beginners welcome in this forum!

Cronjob

👤 Login to reply

 
Thread Tools Search this Thread
# 1  
Old 03-02-2018
Tools Cronjob

How to set cronjob for 48 hours.

I can set for 2 days as shown below.
* * */2 * *

It is creating confusion for 30 days & 31 days per month.
# 2  
Old 03-02-2018
Set it to daily, and let the cron job skip every second time.
Example:
Code:
59 23 * * *  tf=/tmp/tf; if [ -d $tf ]; then rmdir $tf; /path/to/realcronjob; else mkdir $tf; fi

As root the protected /var/run/ is safer than /tmp/.
The Following 2 Users Say Thank You to MadeInGermany For This Useful Post:
hicksd8 (03-02-2018), Nishit (03-02-2018)
# 3  
Old 03-13-2018
this below cron will work.

0 0 2-31/2 * * command2
# 4  
Old 03-13-2018
Quote:
Originally Posted by shajay12
this below cron will work.

0 0 2-31/2 * * command2
When the calendar days are 28,29,30,31,1,2,3,4 it will run the red days, and you see that the "every second day" rule is violated.
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
cronjob Anjan1 UNIX for Dummies Questions & Answers 3 08-26-2011 07:46 AM
Cronjob not exexcuting! nixhead Shell Programming and Scripting 2 10-28-2010 06:07 AM
Cronjob help LinuxNewb UNIX for Dummies Questions & Answers 2 10-14-2010 05:33 AM
how to cancel a cronjob if the cronjob still running 2j4h UNIX for Dummies Questions & Answers 7 08-18-2010 08:16 AM
cronjob maooah AIX 1 02-24-2010 07:28 AM
Cronjob MisterKhan Shell Programming and Scripting 11 03-05-2009 02:58 PM
at vs cronjob mokkan Solaris 1 05-16-2008 11:50 PM
cronjob wiz83 UNIX for Dummies Questions & Answers 1 01-25-2008 01:47 AM
CronJob hcng08 HP-UX 1 08-01-2006 10:44 PM
Cronjob gerwhelan Shell Programming and Scripting 4 12-14-2001 05:17 AM


All times are GMT -4. The time now is 04:33 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?