Backup & restore to ftp sever

I’ve noticed that the new Backup & Restore module (from Schmooze) does no checking of the connection status (or return codes ?) when an ftp server is being used.

As a consequence a scheduled backup can be running and reporting successful completion when no ftp connection has been established and no files transferred.

I’m not sure if this is beyond the scope of the module, but it would be nice if it could report the ftp connection/file transfer failure.

Alan

/*
FTP Sucessfull Backup’s to FTPSERVER
leaves $ftpbackup which gets overwritten next time but can be checked to see if there were errors.
IMPORTANT - if testing as root, delete files since backup runs as asterisk and will fail here since
root leave the file around and asterisk can’t overwrite it.
Note - the hardcoded full backup that cron does will overwrite each day at destination.
*/

So I am guessing this is a log you can review programaticly or manually

exec('ftp -n ’ . $opts[‘ftphost’] . ’ < ’ . $opts[‘ftpfile’] . ’ ',$ftpres);
could become
exec('ftp -n ’ . $opts[‘ftphost’] . ’ < ’ . $opts[‘ftpfile’] . ’ ',$ftpres, $ftpret);

Then action could be determined based on $ftpret
0 No problems occurred.
1 Generic error code.
2 Parse error
3 File I/O error.
4 Network failure.
5 SSL verification failure.
6 Username/password authentication failure.
7 Protocol errors.
8 Server issued an error response.

If ftp server has been configured via the FreePBX UI surely the session is configured to use the asterisk UID?

Or are you confirming that there is a bug?

Alan