Crontab Problem
Hi Everybody,
I am a newbie and i run a debian dist. my problem is to execute a shell script from the crontab daily i create the shell script which logins an ftp site and starts to download files (which are shell script like the crontab entry) after this process it excutes the both two downloaded script. This scripts work fine when i execute them in the command line by command # bash service.sh whenever i create the crontab entry with this script nothing works. Thanks for your help, Soner My scrontab entry script is like this; ======================================= #!/bin/bash/ ftp -n << EOT open XXX.XXX.XXX.XXX user user_name password bin get batch_upload.sh get batch_rename.sh bye EOT chmod 777 batch_upload.sh chmod 777 batch_rename.sh bash /usr/siglo/offline/batch_upload.sh bash /usr/siglo/offline/batch_rename.sh rm -f /usr/siglo/offline/batch_upload.sh rm -f /usr/siglo/offline/batch_rename.sh ======================================= my crontab entry is like this; ======================================= 0 5 * * * /usr/siglo/offline/service.sh ======================================= ps : all my folder and file permission is set to "6777". |
> # bash service.sh
Why you have to run it like this? Do you have the executable bit set? |
No i only want to check wheter this script run correctly or not.
Soner |
Re: Crontab Problem
Quote:
Code:
/usr/siglo/offline/ Code:
exec 2>&1 Greetings, Benjamin |
Hi EveryBody,
I found what is wrong with the batch; The daemon cron dont know about the chmod, ftp or other command because you lost the users crediantials when signout from the session so you must teach the cron daemon the commands that you already use in the batch. So the ftp -n << EOT line will be like this after changes /usr/bin/ftp -n << EOT you can find the exact path by using which command. Thanks for your extra kindness and great help, Best Regards |
All times are GMT -5. The time now is 10:34 PM. |