UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old March 3rd, 2004, 12:10 PM
papajohns's Avatar
papajohns papajohns is offline
perl virgin
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Seattle, WA
Posts: 436 papajohns User rank is Corporal (100 - 500 Reputation Level)papajohns User rank is Corporal (100 - 500 Reputation Level)papajohns User rank is Corporal (100 - 500 Reputation Level)papajohns User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 10 h 30 m 43 sec
Reputation Power: 8
crontab errors

hello,

so i got this perl script...and when i try to run it via command line it works fine..yet when i put the same syntax in crontab it complains

my crontab :

0 8-17 * * 1-5 /home/obtadmin/bin/mac-address-checks.pl create `/usr/bin/date +%m%d%H%M`

and it complains that

Your "cron" job
/home/obtadmin/bin/mac-address-checks.pl create /home/obtadmin/bin/script-data/`date +

produced the following output:

Couldn't open /home/obtadmin/bin/script-data/ for write


so somehow the cron is not evaluating the `/usr/bin/date +%m%d%H%M` correctly..... what must i enclose it in to make it work..like i said, if i just type the same thing in command line then it works..

thanx

Reply With Quote
  #2  
Old March 4th, 2004, 06:40 AM
munkfish's Avatar
munkfish munkfish is offline
funky munky
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 1,446 munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level)munkfish User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 18 h 33 m
Reputation Power: 10
How about:

`/usr/bin/date "+%m%d%H%M"`

Personally though when I get a crontab that has a commandline that's over 1 argument long I usually put the command(s) into a script and just call the script via crontab.

Reply With Quote
  #3  
Old March 4th, 2004, 07:05 AM
Perderabo Perderabo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 121 Perderabo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 54 sec
Reputation Power: 5
Believe it or not, everything after a per cent sign is stripped from a crontab line and is fed to the command as input. I think that a backslash if front of each per cent sign will prevent this.

I agree with munkfish though, just put the line in a scipt and call that.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > crontab errors


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway