

InterviewSolution
1. |
Solve : Cron job not running at all (shell script)? |
Answer» I am trying to setup a cron job but cannot get it to run at all. I have a shell script I want to run and like many others, I can get it to run from the command line but not through cron. I have tried all suggestions I can find but they don't seem to make any difference. 23 15 * * * /home/sde/sdecompress/sde_shutdown.sh > /home/sde/sdecompress/sde_sh You wont see anything happening at 23:15 as this is set to run at 15:23. For testing purposes set it to * * * * * so it runs every minute. Another thing to check, does AIX require that /home/sde/sdecompress/sde_shutdown.sh be listed in /etc/shells ? Quote from: dend on May 18, 2007, 08:34:45 AM .profile Your .profile wont execute within the same shell without a preceding . All commands should use the full pathname as the context of cron jobs is not the same as that inherited from a login E.g.Code: [Select]. /home/sde/.profile /usr/bin/echo this is a test /home/sde/sdecompress/sdemon -o shutdown -p sde -NThanks for your reply, I have been out of the office so couldn't post any sooner. I seem to have a bit more progress now. The script will run (the echo command works), but The problem seems to be RECOGNISING the 'sdemon command'; when I check my mail now it says (PATH name)/sde_shutdown[7]: sdemon: not found. If I were using another language it would be straightforward here - enclose it in quotes to get the whole line to run as it has spaces in. Is there a way around this in Unix?Quote from: dend on May 22, 2007, 04:50:24 AM Thanks for your reply, I have been out of the office so couldn't post any sooner. np Quote The problem seems to be recognising the 'sdemon command'; when I check my mail now it says (path name)/sde_shutdown[7]: sdemon: not found. You can do that in bash/sh on linux/AIX too Code: [Select]"/home/sde path name/sdemon" -o shutdown -p sde -N |
|