1

Topic: backup_mysql.sh errors

iRedMail version 0.9.9
- Linux/BSD distribution name and version: Ubuntu 18.04
- Store mail accounts in which backend MySQL
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? no

I recently migrated to a new server from Ubuntu 14.04 to 18.04 all went smoothly and I replace the backup_mysql.sh backup scripts using the one in /iRedMail-0.9.9/tools/ and copied it to /var/vmail/backup. When I run it I get the following

root@mx01:/var/vmail/backup# sh backup_mysql.sh
/usr/bin/python
backup_mysql.sh: 149: [: X0: unexpected operator
backup_mysql.sh: 149: [: X0: unexpected operator
backup_mysql.sh: 149: [: X0: unexpected operator
backup_mysql.sh: 149: [: X0: unexpected operator
backup_mysql.sh: 149: [: X0: unexpected operator
backup_mysql.sh: 149: [: X0: unexpected operator
backup_mysql.sh: 149: [: X0: unexpected operator
du: cannot access '*2019-12-07-03-27-14*sql*': No such file or directory
backup_mysql.sh: 191: [: XYES: unexpected operator
-e ==> Backup completed with !!!ERRORS!!!.

backup_mysql.sh: 197: [: XYES: unexpected operator
==> Detailed log (/var/vmail/backup/mysql/2019/12/07/2019-12-07-03-27-14.log):
=========================
Database
information_schema
amavisd
iredadmin
iredapd
mysql
performance_schema
roundcubemail
sogo
sys
vmail
* Starting backup: 2019-12-07-03-27-14.
* Backup directory: /var/vmail/backup/mysql/2019/12/07.
* Backing up databases: mysql vmail roundcubemail amavisd iredadmin sogo iredapd.
-e * File size:
----
----
* Backup completed (Success? YES).

check the backup folder /var/vmail/backup/mysql/2019/12/07 all I see is a log file and no sql dumps.

root@mx01:/var/vmail/backup/mysql/2019/12/07# cat 2019-12-07-03-27-14.log
* Starting backup: 2019-12-07-03-27-14.
* Backup directory: /var/vmail/backup/mysql/2019/12/07.
* Backing up databases: mysql vmail roundcubemail amavisd iredadmin sogo iredapd.
-e * File size:
----
----
* Backup completed (Success? YES).

Does anyone have another script I should be using or can suggest any modification I should make?

Thanks,
Tim

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: backup_mysql.sh errors

Please run it with "bash" shell, not "sh".

bash backup_mysql.sh

3

Re: backup_mysql.sh errors

ZhangHuangbin wrote:

Please run it with "bash" shell, not "sh".

bash backup_mysql.sh

Thanks for the reply using bash instead of sh seems to run the script without error.