Unix/Linux Go Back    


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

UNIX for Advanced & Expert Users


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 09-26-2006   -   Original Discussion by baanprog
baanprog's Unix or Linux Image
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 05:18 AM..
Sponsored Links
    #2  
Old Unix and Linux 09-26-2006   -   Original Discussion by baanprog
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 18 January 2018, 3:03 PM EST
Location: Saskatchewan
Posts: 22,574
Thanks: 1,163
Thanked 4,293 Times in 3,961 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 11:54 AM..
Sponsored Links
    #3  
Old Unix and Linux 09-26-2006   -   Original Discussion by baanprog
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 15 January 2018, 9:34 AM EST
Location: NM
Posts: 11,284
Thanks: 581
Thanked 1,127 Times in 1,038 Posts
this works for me:


Code:
[ $(date +%d) -eq $(echo `cal` | awk '{ print $NF-4 }') ] && <cmd goes here>

Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 06:41 PM
crontab is not working!! getrue Red Hat 14 09-08-2011 12:06 PM
crontab not working shifahim UNIX for Dummies Questions & Answers 8 08-16-2011 09:22 AM
crontab not working lg123 UNIX for Dummies Questions & Answers 2 04-24-2011 04:47 PM
crontab not working right kymberm UNIX for Dummies Questions & Answers 3 07-09-2003 05:21 PM



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