in reply to Crontab "Can't open perl script", " No such file or directory"
Hi,
as cron is throwing away most environment variables I do want to have a script run exactly like I would do it on the console. I use two ways:
You want to collect all cron jobs in one crontab of root but want to run them with a certain uid:
* * * * * su - user -c '/usr/bin/perl /home/myuser/scripts/perl/flash. +pl'
or you run it in the crontab of the user and force an environment as if you have logged in:
* * * * * bash -l -c 'usr/bin/perl /home/myuser/scripts/perl/flash.pl'
Probably this would also trigger the mounting of your home directory if this is the reason for your problem.
Regards
McA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Crontab "Can't open perl script", " No such file or directory"
by Anonymous Monk on Oct 09, 2014 at 16:47 UTC | |
by Nemo Clericus (Beadle) on Oct 09, 2014 at 17:36 UTC | |
by Anonymous Monk on Oct 09, 2014 at 20:28 UTC | |
by Anonymous Monk on Oct 09, 2014 at 20:36 UTC | |
by Anonymous Monk on Oct 09, 2014 at 20:42 UTC | |
| |
by Anonymous Monk on Oct 09, 2014 at 20:26 UTC | |
|
Re^2: Crontab "Can't open perl script", " No such file or directory"
by Anonymous Monk on Oct 09, 2014 at 15:07 UTC |