mxgross / EasyBackupBundle

Kimai 2 Plugin for easier backups
MIT License
25 stars 6 forks source link

NOT --version sh: 1: NOT: not found #49

Closed wforumw closed 2 years ago

wforumw commented 2 years ago

Hi, I have installed easybackup as described here In the 'View status checks' overview I get this error

Path '/var/www/kimai2/var' readable     
Path '/var/www/kimai2/var' writable     
Backup directory '/var/www/kimai2/NOT SET' exists   
PHP extension 'zip' loaded  
Kimai version   1.26.0 stable
Database    mysql
NOT --version   sh: 1: NOT: not found
NOT --version   sh: 1: NOT: not found 

Any idea why?

mxgross commented 2 years ago

Hi,

please try recreating the cache and report me if the problem still exists

Inside the /kimai/ directory execute

bin/console cache:clear
bin/console cache:warmup

Sometimes the permissions must be set again

sudo chown -R :www-data .
sudo chmod -R g+r .
sudo chmod -R g+rw var/
sudo chmod -R g+rw public/avatars/

It looks like the configuration could not be read. Maybe also check the Kimai Settings page. At the bottom you will find the EasyBackup settings. Please check if there are valid values existing e.g. for the mysqldump command.

mxgross commented 2 years ago

Otherwise please try replacing the EasyBackupExtension.php with the following file included in the zip. EasyBackupExtension.zip Maybe I have to convert it back to that.

After the replacement you also need to rebuild the cache and maybe set the permissions again.

Please tell me if it works. Thanks

wforumw commented 2 years ago

Thanks for the quick reply Now the checks are fine

/usr/bin/mysqldump --version    mysqldump Ver 10.19 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
/usr/bin/mysql --version    /usr/bin/mysql Ver 15.1 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper 

but if I run the first backup the log tells

INFO: --- S T A R T   C R E A T I N G   B A C K U P ---
INFO: Creating backup dir '/var/www/kimai2/var/easy_backup/2022-10-11_125713/'.
INFO: Creating manifest file '/var/www/kimai2/var/easy_backup/2022-10-11_125713/manifest.json'.
INFO: Get files and dirs to backup.
INFO: Start to backup '/var/www/kimai2/NOT SET'.
It's a directory. Start to mirror it to '/var/www/kimai2/var/easy_backup/2022-10-11_125713/NOT SET'.
INFO: Start database backup.
INFO: Used database: 'mysql'.
ERROR: Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases
OR     mysqldump [OPTIONS] --system=[SYSTEMOPTIONS]]
For more options, use mysqldump --help
INFO: Start zipping '/var/www/kimai2/var/easy_backup/2022-10-11_125713/' to '/var/www/kimai2/var/easy_backup/2022-10-11_125713.zip'.
INFO: Remove temp dir '/var/www/kimai2/var/easy_backup/2022-10-11_125713/'.
INFO: Remove temp file '/var/www/kimai2/var/easy_backup/2022-10-11_125713/database_dump.sql'.
INFO: --- F I N I S H E D   C R E A T I N G   B A C K U P ---

and the backup file is empty still missing something

mxgross commented 2 years ago

Can you add the code $this->log(self::LOG_INFO_PREFIX, $mysqlDumpCmd); in this line here https://github.com/mxgross/EasyBackupBundle/blob/master/Controller/EasyBackupController.php#L532

And then check the log please so we see what command is tried to use. Please remove the password part from the output before you post it here.

Also you can delete the directory "NOT SET" which was created by accident. Thanks.

wforumw commented 2 years ago

It seems to work now

mxgross commented 2 years ago

@wforumw What was the solution to your first problem? Was it the new version of EasyBackupExtension.php or was it just a cache or permisson problem?

Thanks

wforumw commented 2 years ago

At the end I just had to fill out the mysqldump command completely

settings

mxgross commented 2 years ago

Okay thanks. There should be a default entry available already. I changed something with the config and it seem like it is not working in fresh installations / when EasyBackup was never installed before. I will try to test it and fix it. Thanks for your feedback.