mark_nsx Posted March 15, 2010 Share Posted March 15, 2010 Hi there, I have a script that pulls in a weather feed via FTP then writes the output to a file. This script is run everyday at 3pm by cron. Heres the shell script: #!/bin/sh HOST='ftp.weatheronline.co.uk' USER='my username' PASSWD='my password' FILE='/var/www/vhosts/mysite.com/httpdocs/_shell/weatherfeed.csv' touch $FILE ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD get $FILE quit END_SCRIPT and the cron job * 12 * * * /var/www/vhosts/mysite.com/httpdocs/_shell/getweatherfeed And when the cron runs I receive the following error: local: ./var/www/vhosts/mysite.com/httpdocs/_shell/weatherfeed.csv: No such file or directory Im just confused why the script is not running as it should. The permissions on the folder _shell is 777. Any help is much appreciated! I've been stuck on this problem for 2 days now :'( Quote Link to comment https://forums.phpfreaks.com/topic/195373-shell-script-and-cron/ Share on other sites More sharing options...
burtybob Posted March 16, 2010 Share Posted March 16, 2010 Firstly I shall presume that you have put "mysite.com" to prevent spam and that in your real shell script you have put the proper one. My second question, although maybe obvious, is does the file exist inside the folder? "No such file or directory" is generally when a file or folder is not located where you tell it to be? So have you tried navigating to that file manually? If that works then I am lost Also the folder being 777 doesn't mean the file is 777 Quote Link to comment https://forums.phpfreaks.com/topic/195373-shell-script-and-cron/#findComment-1027038 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.