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
In reply to Re: Crontab "Can't open perl script", " No such file or directory"
by McA
in thread Crontab "Can't open perl script", " No such file or directory"
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |