Backup.sh script giving strange error not seen before


(Nic Hubbard) #1

Matrix Version: 5.4.3.1

We are needing to move our Matrix install from one server to another, so I am needing to use the backup.sh script, which I have used many times before. Strangely I get this error:

/opt/matrix/scripts/backup.sh: 328: /opt/matrix/scripts/backup.sh: [[: not found
/opt/matrix/scripts/backup.sh: 343: /opt/matrix/scripts/backup.sh: [[: not found
/opt/matrix/scripts/backup.sh: 795: /opt/matrix/scripts/backup.sh: [[: not found
Backup failed
gzip: compressed data not written to a terminal. Use -f to force compression.
For help, type: gzip -h

Has anyone seen this before or know why this would happen?


(Chiranjivi Upreti) #2

Tested my local system and had no issues.

How exactly are you running it?


(Nic Hubbard) #3

Running it as root and using the manuals as a guide:

./scripts/backup.sh /opt/matrix


(Chiranjivi Upreti) #4

Thats strange. I am running the same version of the script and I am getting any errors.

This is the only issue I am aware that not been fixed yet: https://squizmap.squiz.net/matrix/12174


(Nic Hubbard) #5

It is strange.

I had to do bash ./scripts/backup.sh /opt/matrix before it would work. Never had to do that before!


(David Schoen) #6

You must have an actual posix shell at /bin/sh (basically unheard of in our hosting) and our backup.sh still specifies (incorrectly) /bin/sh despite using bashisms (the [[ is a bash keyword).

Calling it the way you do is a fine work around.


(David Schoen) #7

I’ve lodged a bug for this: https://jira.squiz.net/browse/MATRIX-903