Uploaded image for project: 'FreePBX'
  1. FreePBX
  2. FREEPBX-16525

Backup to FTP - Works only once

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Third Party Issue
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Backup & Restore
    • Labels:
      None
    • ToDo:
    • Asterisk Version:
      13.18.4
    • Distro Version:
      14.0.1.24
    • Distro:
      FreePBX Distro

      Description

      I’m trying to backup call recordings nightly to my computer via FTP.  To test, I set it up to save the backup to the folder “test” on my desktop. This worked the first time. It created the folder C:\Users\USERNAME\Desktop\test\Call_Recording_Backup and put the .tgz file in that folder. However, if I run the backup again 10 minutes later it fails. If I delete the folder Call_Recording_Backup (and the .tgz file) the backup will succeed again.

      My PBX server is on the same local network as my computer with the FTP server.

      Logs for a successful backup the first time it is run.

      PBX

       

      
      Saving Backup 6…done!
      Initializing Backup 6
      Backup Lock acquired!
      Running pre-backup hooks…
      Adding items…
      Building manifest…
      Creating backup…
      Storing backup…
      Creating directory '/Call_Recording_Backup’
      Saving file to remote ftp
      Backup file uploaded to the remote server
      Running maintenance…
      Whoops\Exception\ErrorException: Argument 1 passed to Touki\FTP\Model\Filesystem::setMtime() must be an instance of DateTime, boolean given, called in /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/WindowsFilesystemFactory.php on line 50 and defined in file /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Model/Filesystem.php on line 260
      Stack trace:
      
      Whoops\Exception\ErrorException->() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Model/Filesystem.php:260 Whoops\Run->handleError() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Model/Filesystem.php:260 Touki\FTP\Model\Filesystem->setMtime() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/WindowsFilesystemFactory.php:50 Touki\FTP\WindowsFilesystemFactory->build() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:82 Touki\FTP\Manager\FTPFilesystemManager->findBy() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:106 Touki\FTP\Manager\FTPFilesystemManager->findAll() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/FTP.php:99 Touki\FTP\FTP->findFilesystems() /var/www/html/admin/modules/backup/functions.inc/class.backup.php:742 FreePBX\modules\Backup\Backup->maintenance() /var/www/html/admin/modules/backup/functions.inc/class.backup.php:505 FreePBX\modules\Backup\Backup->store_backup() /var/www/html/admin/modules/backup/bin/backup.php:148 

      Filezilla server logs

      
      (000024)1/4/2018 12:37:10 PM - (not logged in) (192.168.1.109)> Connected on port 64492, sending welcome message…
      (000024)1/4/2018 12:37:10 PM - (not logged in) (192.168.1.109)> 220-FileZilla Server 0.9.60 beta
      (000024)1/4/2018 12:37:10 PM - (not logged in) (192.168.1.109)> 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
      (000024)1/4/2018 12:37:10 PM - (not logged in) (192.168.1.109)> 220 Please visit https://filezilla-project.org/
      (000024)1/4/2018 12:37:10 PM - (not logged in) (192.168.1.109)> USER PBX
      (000024)1/4/2018 12:37:10 PM - (not logged in) (192.168.1.109)> 331 Password required for pbx
      (000024)1/4/2018 12:37:10 PM - (not logged in) (192.168.1.109)> PASS ********
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 230 Logged on
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> TYPE A
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 200 Type set to A
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> PORT 192,168,1,109,218,22
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 200 Port command successful
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> LIST /
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 150 Opening data channel for directory listing of “/”
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 226 Successfully transferred “/”
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> PORT 192,168,1,109,129,177
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 200 Port command successful
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> LIST /
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 150 Opening data channel for directory listing of “/”
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 226 Successfully transferred “/”
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> MKD /Call_Recording_Backup
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 257 “/Call_Recording_Backup” created successfully
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> TYPE I
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 200 Type set to I
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> PORT 192,168,1,109,134,33
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 200 Port command successful
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> STOR /Call_Recording_Backup/20180104-123655-1515091015-14.0.1.24-438879149.tgz
      (000024)1/4/2018 12:37:10 PM - pbx (192.168.1.109)> 150 Opening data channel for file upload to server of “/Call_Recording_Backup/20180104-123655-1515091015-14.0.1.24-438879149.tgz”
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> 226 Successfully transferred “/Call_Recording_Backup/20180104-123655-1515091015-14.0.1.24-438879149.tgz”
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> TYPE A
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> 200 Type set to A
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> PORT 192,168,1,109,191,171
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> 200 Port command successful
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> LIST /Call_Recording_Backup
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> 150 Opening data channel for directory listing of “/Call_Recording_Backup”
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> 226 Successfully transferred “/Call_Recording_Backup”
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> QUIT
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> 221 Goodbye
      (000024)1/4/2018 12:37:17 PM - pbx (192.168.1.109)> disconnected.

       

      Logs for a failed backup - when running the backup a 2nd or more times

      PBX

       

      
      Saving Backup 6…Initializing Backup 6
      Backup Lock acquired!
      Running pre-backup hooks…
      Adding items…
      Building manifest…
      Creating backup…
      Storing backup…
      Whoops\Exception\ErrorException: Argument 1 passed to Touki\FTP\Model\Filesystem::setMtime() must be an instance of DateTime, boolean given, called in /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/WindowsFilesystemFactory.php on line 50 and defined in file /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Model/Filesystem.php on line 260
      Stack trace:
      
      Whoops\Exception\ErrorException->() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Model/Filesystem.php:260 Whoops\Run->handleError() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Model/Filesystem.php:260 Touki\FTP\Model\Filesystem->setMtime() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/WindowsFilesystemFactory.php:50 Touki\FTP\WindowsFilesystemFactory->build() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:162 Touki\FTP\Manager\FTPFilesystemManager->findOneBy() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:262 Touki\FTP\Manager\FTPFilesystemManager->findDirectoryByName() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:273 Touki\FTP\Manager\FTPFilesystemManager->findDirectoryByDirectory() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/FTP.php:148 Touki\FTP\FTP->directoryExists() /var/www/html/admin/modules/backup/functions.inc/class.backup.php:479 FreePBX\modules\Backup\Backup->store_backup() /var/www/html/admin/modules/backup/bin/backup.php:148
      done! 

      Filzilla FTP Server

       

      
      (000025)1/4/2018 12:40:35 PM - (not logged in) (192.168.1.109)> Connected on port 64492, sending welcome message…
      (000025)1/4/2018 12:40:35 PM - (not logged in) (192.168.1.109)> 220-FileZilla Server 0.9.60 beta
      (000025)1/4/2018 12:40:35 PM - (not logged in) (192.168.1.109)> 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
      (000025)1/4/2018 12:40:35 PM - (not logged in) (192.168.1.109)> 220 Please visit https://filezilla-project.org/
      (000025)1/4/2018 12:40:35 PM - (not logged in) (192.168.1.109)> USER PBX
      (000025)1/4/2018 12:40:35 PM - (not logged in) (192.168.1.109)> 331 Password required for pbx
      (000025)1/4/2018 12:40:35 PM - (not logged in) (192.168.1.109)> PASS ********
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> 230 Logged on
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> TYPE A
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> 200 Type set to A
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> PORT 192,168,1,109,187,112
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> 200 Port command successful
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> LIST /
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> 150 Opening data channel for directory listing of “/”
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> 226 Successfully transferred “/”
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> QUIT
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> 221 Goodbye
      (000025)1/4/2018 12:40:35 PM - pbx (192.168.1.109)> disconnected.
      

       

      Filezilla server has full permissions for the folder C:\Users\USERNAME\Desktop\test\

      On a failed backup the first backup file is still there, but a new backup file is not added. Ideally, I’d like to backup it up each night and keep about 5 backup files in there. I have the “delete after” setting in PBX currently at “1 run” for testing.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jfinstrom James Finstrom
                Reporter:
                Bradbpw Bradbpw
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Feedback Requested:

                  NextupJiraPlusStatus

                  Error rendering 'slack.nextup.jira:nextup-jira-plus-status'. Please contact your Jira administrators.