0

I am trying to run the following cronjob and I am getting the following error:

/bin/sh: -c: line 0: syntax error near unexpected token `)'

for the line:

mysqldump --opt -Q -h localhost --user=my_username --password=pass)word db_name | gzip -v9 - > db_backup.sql.gz

How do I properly run this cronjob to prevent issues with characters in the password?

user9517
  • 115,471
  • 20
  • 215
  • 297
Kyle
  • 111
  • 3

1 Answers1

3

Put the password in single quotes to avoid sh from processing the string. I.E.

--password='pass)word'
mdpc
  • 11,856
  • 28
  • 53
  • 67
  • 1
    Or better yet, put it in a `.my.cnf` file in the appropriate user's home directory with appropriate ownership and permissions. – Ladadadada Oct 29 '12 at 19:24