FreePBX / issue-tracker

The unified FreePBX issue tracker.
https://www.freepbx.org
GNU General Public License v3.0
9 stars 1 forks source link

[bug]: Fb 17 Backup customdir #165

Closed tpimont closed 5 months ago

tpimont commented 5 months ago

FreePBX Version

FreePBX 17

Issue Description

Custom dir are not added to backup error message -> /tmp/backup/99a491b5-5b1b-47a7-b911-e0cfa781480b/customdir/tftpboot/'" failed. Exit Code: 2(Misuse of shell builtins)

Operating Environment

FB 17 Asterisk 20.6 Backup module 17.0.5.21-22-23-24 same problem

Relevant log output

[2024-05-15 09:16:31] [99a491b5-5b1b-47a7-b911-e0cfa781480b.INFO]: The command "'--exclude=node_modules' '--exclude=*tgz' '--exclude=*gpg' '--exclude=.git' '-rlptgov' '/tftpboot/' '/tmp/backup/99a491b5-5b1b-47a7-b911-e0cfa781480b/customdir/tftpboot/'" failed.  Exit Code: 2(Misuse of shell builtins)  Working directory: /var/www/html/admin  Output: ================   Error Output: ================ sh: line 1: exec: --: invalid option exec: usage: exec [-cl] [-a name] [command [argument ...]] [redirection ...]  [] []
[2024-05-15 09:16:31] [99a491b5-5b1b-47a7-b911-e0cfa781480b.DEBUG]:     Adding custom directory to tar: customdir/tftpboot [] []
jissphilip commented 5 months ago

HI @tpimont We are unable to reproduce the issue with backup 17.0.5.24 .

tpimont commented 5 months ago

my installation is on Rocky 9 with open source modules, dont know if that help .

jissphilip commented 5 months ago

@tpimont We are using 'rsync' copy the files . Is this package is installed on you system ?

tpimont commented 5 months ago

Rsync was not installed, after installation backup is ok with custom dir included and no error . Thanks for the quick answer

But restore is not , error was Running with: /usr/sbin/fwconsole backup --restore='/var/spool/asterisk/backup/20240515-115011-1715766611-17.0.15.21-2099799325.tar.gz' --transaction='1644430d-6bcd-4745-a214-607df42f01c1' Determining backup file type...type is current

In Backup.class.php line 1585:

Sysadmin RPM not up to date

backup [--backup BACKUP] [--externbackup EXTERNBACKUP] [--dumpextern DUMPEXTERN] [--transaction TRANSACTION] [--list] [--warmspare] [--implemented] [--filestore FILESTORE] [--restore RESTORE] [--restorelegacycdr] [--ignoremodules IGNOREMODULES] [--modules MODULES] [--restoresingle RESTORESINGLE] [--backupsingle BACKUPSINGLE] [--singlesaveto SINGLESAVETO] [--b64import B64IMPORT] [--fallback] [--useinfiledb] [--skiprestorehooks] [--skipbindport] [--skipdns] [--skipremotenat] [--skiptrunksandroutes] [--skipchansipexts] [--convertchansipexts] [--skipchansiptrunks] [--convertchansiptrunks]

tpimont commented 5 months ago

Try to install sysadmin module but got same error Sysadmin RPM not up to date .

/var/www/html/admin/modules/sysadmin/Sysadmin.class.php Sysadmin RPM not up to date

PHP 8.2.16 (cli) (built: Feb 13 2024 15:22:59) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.2.16, Copyright (c) Zend Technologies with the ionCube PHP Loader v13.0.3, Copyright (c) 2002-2024, by ionCube Ltd. with Zend OPcache v8.2.16, Copyright (c), by Zend Technologies

tpimont commented 5 months ago

In Backup.class.php line 1585 commented out

public function runHook($hookname, $params = false) { // Runs a new style Syadmin hook //if (!file_exists("/etc/incron.d/sysadmin")) { // throw new \Exception("Sysadmin RPM not up to date"); //}

and restore is OK

kguptasangoma commented 5 months ago

Thanks for reporting this issue @tpimont , we have fixed the issue and you can retry with backup v17.0.5.25.

Removed runHook api as that was not required.