Results 1 to 4 of 4
January 15th, 2006, 11:40 AM #1ftp get not working.
I've developed some php scripts that automatically download and populate my databases. They work flawlessly when executed from my desktop browser.
I set them up to run as cron jobs through cpanel on my server directly so I won't have to think about it.
The scripts that retrieve files via a http address work fine BUT my scripts that log into an ftp server(CJ) and try to download the file fail.
The connection is made but I get this error:
ftp_get(): Error opening *******_5604_20060114.txt.gz
So for some reason it can't open the file. I have searched all over for any correlation between ftp_get and cron and I can't find anything specifically about it.
These scripts do work but not when executed through cron.
Here is my cron command:
php -f /home/*****/public_html/test/download.php
Anyone with any experience with this??
January 15th, 2006, 01:24 PM #2
- Join Date
- January 18th, 2005
This is what I use for my PHP cron jobs:
lynx --dump http://www.url.com/test/download.php >> /dev/null
January 15th, 2006, 01:32 PM #3
suzigeek, it's hard to tell without more details, but given that it works from the command-line, but not from cron, it's probably a permissions problem or the path that's getting used by the script in cron is not valid.
In the script, try explicitly specifying the path to where the file is to be stored.
And, if that doesn't work, try creating and specifying a directory with world write privileges (chmod 777 dirname) and download the file there. With those open permissions, use a subdirectory that's only used for this purpose.
Like chet, I use another method. I use wget or curl to get the file and then perl or php to operate on the downloaded file.
wget -q ftp://user:email@example.com/filename.txt
January 15th, 2006, 01:50 PM #4
Thanks for your help I ended up testing ftp_pasv option to false and that got it to work!
edited: on a side not I used google for my initial search and it gave me squat, then I tried msn again not much-- surprisingly enough Yahoo yeilded the best search results for me today. Actual information, not a bunch of garbage which Google seemed to have the most of.
Last edited by suzigeek; January 15th, 2006 at 02:10 PM.Suz~~GearGirl~~
By glittered in forum Google Affiliate Network - GANReplies: 2Last Post: January 1st, 2010, 05:34 AM
By Gordon in forum Rakuten LinkShare - LSReplies: 12Last Post: June 24th, 2005, 05:13 PM
By mprime in forum WebMerge (Fourthworld.com)Replies: 1Last Post: March 11th, 2004, 02:19 PM