FTP fails to connect when executed by CRON | General Questions and Support | Forum Archive

The free forums are no longer in use. It remains available as read-only archive.

Avatar
Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
The forums are currently locked and only available for read only access
sp_TopicIcon
FTP fails to connect when executed by CRON
January 30, 2013
10:34 pm
Avatar
matt
Member
Members
Forum Posts: 5
Member Since:
January 30, 2013
sp_UserOfflineSmall Offline

Hi,

 

I have multiple cron jobs setup to send the backups to a remote FTP server.  When I run the cron jobs manually from xcloner (from the cron tab, using the "execute cron" link next to each config file) they work perfectly... with the backup file landing safely on the remote ftp server.

 

But when the jobs are executed by cron the backups complete ok (and end up in the administrator\backups folder of the local host) but the FTP always fail with the error ftp_login() expects parameter 1 to be resource, boolean given

 

I have tried using the hostname and the IP address of the FTP server, and also using both the Direct and Passive mode FTP settings in xcloner.  Just to re-iterate, the FTP works fine if I run the cron job from xcloner - it only fails when run via cron.

 

FYI regarding the cron jobs; they are being run from my GoDaddy hosting panel using the following code:

/web/cgi-bin/php5 "$HOME/html/<site name>/administrator/components/com_xcloner-backupandrestore/cloner.cron.php" db_backup.php

(this was the only format I could find that allowed the job to execute at all)

 

Many thanks for your help!

Matt

January 31, 2013
12:10 pm
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

If you made any changes to your cron settings, make sure you update your db_backup.php cron config as well by re-saving it, see if you have anymore issues afterwards!

January 31, 2013
12:19 pm
Avatar
matt
Member
Members
Forum Posts: 5
Member Since:
January 30, 2013
sp_UserOfflineSmall Offline

Many thanks but I did ensure that the different settings were saved.

 

For some reason the FTP is just not working when triggered by CRON 🙁

January 31, 2013
6:28 pm
Avatar
Ovidiu Liuta
Admin
Forum Posts: 2484
Member Since:
September 26, 2010
sp_UserOfflineSmall Offline

Try and check with your hosting support to see if they can help further, it could be an issue from the hosting server firewall, althrough i am not sure why since it works on the other mode!

February 2, 2013
9:05 am
Avatar
matt
Member
Members
Forum Posts: 5
Member Since:
January 30, 2013
sp_UserOfflineSmall Offline

Unfortunately GoDaddy were not much help at all, but I have resolved the issue thanks to another forum post regarding GoDaddy vs CRON in general...

 

My fix, in case it should help anyone else in the future, was not to use /web/cgi-bin/php5 etc etc, but to call the cloner.cron.php file using wget, as follows:

/usr/bin/wget -O - -q "http://<website url>/administrator/components/com_xcloner-backupandrestore/cloner.cron.php?config=db_backup.php"

 

For whatever reason using PHP doesn't allow the FTP to work, but the above does 🙂

 

xCloner rocks, thank you for such an awesome plug-in !!

Forum Timezone: America/Chicago
Most Users Ever Online: 867
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
mlguru: 30
Django29: 29
Andy: 21
D: 21
Marcus: 20
Jamie F: 19
Member Stats:
Guest Posters: 738
Members: 10030
Moderators: 2
Admins: 3
Forum Stats:
Groups: 3
Forums: 7
Topics: 2397
Posts: 8236
Newest Members:
Omar Vera
Moderators: TriP: 0, Steve Burge: 0
Administrators: Ovidiu Liuta: 2484, Victor Drover: 1, Valentin Barbu: 0