UNIX for Advanced & Expert Users

Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

crontab NOT working

👤 Login to reply
Thread Tools Search this Thread Display Modes
Old 09-26-2006
baanprog baanprog is offline
Registered User
Join Date: Mar 2005
Last Activity: 10 October 2014, 5:33 AM EDT
Posts: 40
Thanks: 7
Thanked 0 Times in 0 Posts
crontab NOT working


I have put the following entry in crontab and it is NOT working

HTML Code:
1 * * * * [ `date +%d` -eq `echo \`cal\` | awk '{print $NF-4}'` ] && /mybin/myjob.sh
As today is Sep 26th, Iam using NF-4 to test.


Last edited by baanprog; 09-26-2006 at 04:18 AM..
Sponsored Links
Old 09-26-2006
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
Join Date: Aug 2005
Last Activity: 17 July 2018, 11:41 AM EDT
Location: Saskatchewan
Posts: 22,724
Thanks: 1,193
Thanked 4,350 Times in 4,005 Posts
[edit] I shouldn't post when it's this early in the morning. OK. I see what you're code is doing now. What are the permissions on the script file?

Last edited by Corona688; 09-26-2006 at 10:54 AM..
Sponsored Links
Old 09-26-2006
jim mcnamara jim mcnamara is offline Forum Staff  
Join Date: Feb 2004
Last Activity: 17 July 2018, 10:21 PM EDT
Location: NM
Posts: 11,440
Thanks: 637
Thanked 1,176 Times in 1,082 Posts
this works for me:
[ $(date +%d) -eq $(echo `cal` | awk '{ print $NF-4 }') ] && <cmd goes here>

Sponsored Links
👤 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
crontab not working isaacniu Solaris 6 01-09-2012 05:41 PM
crontab is not working!! getrue Red Hat 14 09-08-2011 11:06 AM
crontab not working shifahim UNIX for Dummies Questions & Answers 8 08-16-2011 08:22 AM
crontab not working lg123 UNIX for Dummies Questions & Answers 2 04-24-2011 03:47 PM
crontab not working right kymberm UNIX for Dummies Questions & Answers 3 07-09-2003 04:21 PM

All times are GMT -4. The time now is 03:00 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?