Question

All I want is to backup the database using cronjob. I keep getting this error.

Error /usr/local/cpanel/bin/jailshell: -c: line 0: unexpected EOF while looking for matching `"' /usr/local/cpanel/bin/jailshell: -c: line 1: syntax error: unexpected end of file

Cronjob

root mysqldump -e --user=t***b --password=1*** --all-databases | gzip | uuencode `date-database.sql.gz | mail -s "`dateweb1_iepe-wp.sql.gz mysqldump backup" ***@gmail.com
Was it helpful?

Solution

I think jailshell has a problem with shell substitution. I worked around this by creating the command in php.

echo "<?php date_default_timezone_set('America/New_York'); passthru( '/usr/bin/mysqldump -uXXX -pYYY db_name > /home/mysql_backups/backup-'.date(DATE_ATOM));" | php -q 

This worked for me inside a cPanel cron job, which uses jailshell

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top