Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Dec 03, 2004 12:32 pm 
Offline
Newbie

Joined: Fri Dec 03, 2004 12:11 pm
Posts: 3
Location: not where i wanna be
this works in my cron tab
Quote:
15 14 * * * ~/test.pl
and this does not get executed (modified slightly for posting here)
Quote:
50 10 * * * ~/test.pl none
50 10 * * * '~/test.pl single'
50 10 * * * "~/test.pl double"
i've tried using single and double quotes around it to no avail.
could someone explain why it is not taking the arguments given to it?

when i modified test.pl to have optional arguments the arguments failed to show.

note: i would greatly prefer an explanation of why the argument failed to be taken in the cron job than someone posting a fixed version that does work. i will learn much more by reading the explanation


Top
   
 Post subject:
PostPosted: Fri Dec 03, 2004 2:38 pm 
Offline
Senior Member

Joined: Fri Aug 06, 2004 5:49 pm
Posts: 158
I believe the line is executed with /bin/sh, putting it in quotes is like passing a string around. You probably want:

50 10 * * * `~/test.pl single`

Put in `command`, not 'command'. I'm not entirely sure though, but worth a shot.


Top
   
 Post subject:
PostPosted: Fri Dec 03, 2004 7:16 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2003 2:28 pm
Posts: 245
tierra wrote:
I believe the line is executed with /bin/sh, putting it in quotes is like passing a string around. You probably want:

50 10 * * * `~/test.pl single`

Put in `command`, not 'command'. I'm not entirely sure though, but worth a shot.

No, with backquotes, it will try to execute the output of "~/test.pl single", which unlikely to be useful.

To the original poster: you *have* checked to make sure it runs
from the command line, yes? Under /bin/sh? Try
Code:
/bin/sh -c '~/test.pl single'

In the crontab itself, you do NOT want quotes around the whole thing, your first line
Code:
50 10 * * *  ~/test.pl none

should work.[/code]

_________________
The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world.
-- seen on the net


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group