2

I'm new on linux user

I try to run crontab to backup my database with vagrant user

* * * * * /usr/bin/mysqldump -h localhost -u root -p root mydb | gzip > /var/backup/all/database_`date +%Y-%m-%d`.sql.gz >/dev/null 2>&1

when the crontab run there is no backup file in the folder (my backup/all is chmod 755).

This is error from /var/log/syslog

Aug 16 11:55:01 precise64 CRON[2213]: (vagrant) CMD (/usr/bin/mysqldump -h localhost -u root -p root mydb | gzip > /var/backup/all/database_`date +%Y-%m-%d`.sql.gz >/dev/null 2>&1)
Aug 16 11:55:01 precise64 CRON[2212]: (CRON) info (No MTA installed, discarding output)

So I think

  1. it's about crontab can't create backup file because of Permission denied.
  2. it's about I'm didn't install MTA but I use >/dev/null 2>&1 to disable crontab to sent it to email why it error ?

Thanks for help me.

0 Answers0