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
    #1  
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

Hi,

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.

Thanks

Last edited by baanprog; 09-26-2006 at 04:18 AM..
Sponsored Links
    #2  
Old 09-26-2006
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 20 July 2018, 3:26 PM EDT
Location: Saskatchewan
Posts: 22,727
Thanks: 1,194
Thanked 4,351 Times in 4,006 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
    #3  
Old 09-26-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 20 July 2018, 10:42 AM EDT
Location: NM
Posts: 11,441
Thanks: 638
Thanked 1,176 Times in 1,082 Posts
this works for me:
Code:
[ $(date +%d) -eq $(echo `cal` | awk '{ print $NF-4 }') ] && <cmd goes here>

Sponsored Links
👤 Login to reply

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 11:51 PM.

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





Not a Forum Member?
Forgot Password?