Looks ok. I don't think you need execute permission either, just read permission would do, because you're passing the file to the interpreter.
Verify that:
* Interpreter path is correct
* Program does not have errors and you are able to run it yourself
* It has correct permissions for accessing files etc as the user you've setup the cron for
* If you're just printing stuff remember it doesn't have $stdout or $stderr to write to, redirect those to some log file
Hope this helps
···
On 05/01/12 4:00 PM, CC Chen wrote:
Hi all,
I used crontab command such as
"*/5 * * * * /usr/local/bin/ruby /local/myuser/rubyscript/script1.rb"
But it can't execute script1.rb, I let it print some message every 5
min.
I am quite noob
however...
if your script does use gui, maybe you must use
DISPLAY=:0.0
*/5 * * * * /usr/local/bin/ruby /local/myuser/rubyscript/script1.rb
a useful link may be
CC Chen wrote in post #1039530:
···
Hi all,
I used crontab command such as
"*/5 * * * * /usr/local/bin/ruby /local/myuser/rubyscript/script1.rb"
But it can't execute script1.rb, I let it print some message every 5
min.
Run 'env -i $SHELL --norc'. It will bring up a new naked shell that is equivalent to what cron runs. Run your command as-is in this shell to ensure it works correctly.
···
On Jan 5, 2012, at 02:30 , CC Chen wrote:
Hi all,
I used crontab command such as
"*/5 * * * * /usr/local/bin/ruby /local/myuser/rubyscript/script1.rb"
But it can't execute script1.rb, I let it print some message every 5
min.
On Thu, Jan 5, 2012 at 10:34 AM, Giampiero Zanchi <cidza@tin.it> wrote:
I am quite noob
however...
if your script does use gui, maybe you must use
DISPLAY=:0.0
*/5 * * * * /usr/local/bin/ruby /local/myuser/rubyscript/script1.rb
Looks ok. I don't think you need execute permission either, just read
permission would do, because you're passing the file to the interpreter.
Verify that:
* Interpreter path is correct
* Program does not have errors and you are able to run it yourself
* It has correct permissions for accessing files etc as the user
you've setup the cron for
* If you're just printing stuff remember it doesn't have $stdout or
$stderr to write to, redirect those to some log file
Run 'env -i $SHELL --norc'. It will bring up a new naked shell that is
equivalent to what cron runs. Run your command as-is in this shell to
ensure it works correctly.
So I add this command 'env -i $SHELL --norc' on crontab directly?
Btw, you do not have those quotes at the beginning and end of the line
in your crontab, do you? If yes, you must remove them.
Kind regards
robert
···
On Fri, Jan 6, 2012 at 3:20 AM, CC Chen <dickyhide@gmail.com> wrote:
Ryan Davis wrote in post #1039638:
On Jan 5, 2012, at 02:30 , CC Chen wrote:
Does the crontab command is right?
Run 'env -i $SHELL --norc'. It will bring up a new naked shell that is
equivalent to what cron runs. Run your command as-is in this shell to
ensure it works correctly.
So I add this command 'env -i $SHELL --norc' on crontab directly?