1833883 Members
1714 Online
110063 Solutions
New Discussion

with & without cron

 
Josef Forman
Frequent Advisor

with & without cron

Hi everybody!
I wrote short perl script - it runs perfectly directly from shell, but it fails if it runs fron cron.

Any big basic mistake i did?

PF
6 REPLIES 6
Josef Forman
Frequent Advisor

Re: with & without cron

I solved my problem - I add to crontab some variables - everything OK

PF
Petr Simik_1
Valued Contributor

Re: with & without cron

put variables envirinment inside the script.
.profile.

Rule of crontab is you have to specify path everywhere or use PATH environment (export PATH=/...).


tony j. podrasky
Valued Contributor

Re: with & without cron

Another way is to to the directory
where you are having the action take place.
REMEMBER: Once you eliminate your #1 problem, #2 gets a promotion.
Jan Sladky
Trusted Contributor

Re: with & without cron

Hi mighty Josef,

I guess some variables are missing in your script, so put them in your .profile OR into the script, OR directly in crontab

br Jan
GSM, Intelligent Networks, UNIX
Josef Forman
Frequent Advisor

Re: with & without cron

thanks
--adding variables to my script is right answer.
Josef Forman
Frequent Advisor

Re: with & without cron

THANKS