a week ago i made a successful crontab that execute bash scripting daily, it worked well
but now, it doesn't work at all, in the mail i have:
"
/home/jimmy/cha/scripts/cekpderr
produced the following output:
lagi jalan
/home/jimmy/cha/scripts/cekpderr: isql: command not found
nawk: can't open file /home/jimmy/cha/db/cekpderr.db
source line number 1
isi variabel var adalah
/home/jimmy/cha/scripts/cekpderr: [: =: unary operator expected
cat: cannot open /home/jimmy/cha/db/cekpderr.db
"
i wonder why suddenly the crontab cannot execute the isql command.
and...
when i execute the script manually, not with crontab, it works well and produce the expected result
i have also tried to run the crontab using another user in the same group.
This part in the Cron tutorial speaks to your problem:
It works from the command line but not in crontab
This is perhaps our number one complaint with cron. When you login to Unix, startup scripts setup your environment. You can see your environment with the commands "printenv" or "env". On the other hand, cron sets up only a sparse environment (See Problem with crontab for the details.)
I think that the best solution is to write shell scripts that set up their own environment and run these via cron. That's what worked in not running in cron.
In ping from cron, the user used an absolute path rather than redefining the PATH environment variable.
In this thread: Cron problem?, the user sourced the .profile file to set up the environment and it worked. But that technique caused a problem in stty: tcgetattr: Not a typewriter And I also think that it sets you up for a mysterious problem. Change .profile and your cronjobs may suddenly fail.
Check that part out and the links provided. They should point you in the right direction. Good Luck.