Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why I'm getting unexpected EOF for my cron job?

Tags:

shell

cron

I am receiving an error with my Cron job. The error I keep getting is:

/bin/sh: -c: line 0: unexpected EOF while looking for matching `'' /bin/sh: -c: line 1: syntax error: unexpected end of file 

Here is my code:

mysqldump -u database_user -p']T%zw51' database > /home/site/public_html/Secure/Cron/Database_Backup/database_backup.sql 
like image 386
three3 Avatar asked Jan 22 '13 21:01

three3


1 Answers

You may need to escape the % with a \. % is a special character to the crontab, which gets translated to a newline, so your code was probably becoming

 -p']T  zw51' 

Try:

 -p']T\%zw51' 
like image 110
Faiz Avatar answered Sep 23 '22 02:09

Faiz