mysqldump error on bash script I'm trying to run a bash script to backup my database with Cronjob.

# Backup and compress each database
for database in $mysql_databases
do
  if [ "${database}" == "information_schema" ] || [ "${database}" == "performance_schema" ]; then
        additional_mysqldump_params1="--single-transaction"
  else
        additional_mysqldump_params=""
  fi
  echo "Creating backup of \"${database}\" database"
  mysqldump ${additional_mysqldump_params} --user=${mysql_user} --password=${mysql_password} ${database} | gzip &gt; "${backup_dir}/${database}.gz"
  chmod 600 "${backup_dir}/${database}.gz" ${additional_mysqldump_params1}
done


but the --single-transaction option is not recognized
OBSERVATION #1
It is not recognized because of a typo
You have
  if [ &quot;${database}&quot; == &quot;information_schema&quot; ] || [ &quot;${database}&quot; == &quot;performance_schema&quot; ]; then
        additional_mysqldump_params1=&quot;--single-transaction&quot;
  else
        additional_mysqldump_params=&quot;&quot;
  fi

It should be
  if [ &quot;${database}&quot; == &quot;information_schema&quot; ] || [ &quot;${database}&quot; == &quot;performance_schema&quot; ]; then
        additional_mysqldump_params=&quot;--single-transaction&quot;
  else
        additional_mysqldump_params=&quot;&quot;
  fi

Please change the additional_mysqldump_params1 to additional_mysqldump_params
OBSERVATION #2
You have
chmod 600 &quot;${backup_dir}/${database}.gz&quot; ${additional_mysqldump_params1}

It should read
chmod 600 &quot;${backup_dir}/${database}.gz&quot;

Please remove additional_mysqldump_params1 from that line of code
OBSERVATION #3
There is no need to mysqldump information_schema or performance_schema databases

The INFORMATION_SCHEMA database is made of up in-memory temporary tables. They are dynamically generated and populated on mysqld startyo.
The PERFORMANCE_SCHEMA database is for the instrumentation of measuring performance. Each individual MySQL instance is responsible for populating it with instrumentation data when it is in use.