0

I have a cron job set up

0 0 * * * /usr/bin/mysqldump -u omeka_admin -h localhost omeka > /home/groups/omeka/database/omeka.sql > /dev/null

Pass is stored in .my.cnf. It works great from the command line but everytime cron executes it, the resulting file is size zero

I tried putting in the pass, but got the same result. Again, it works great from the command line. Just in case there was some weird process going that interfered with the output but it's still not working

Any idea of what's going on?

juergen d
  • 201,996
  • 37
  • 293
  • 362
Kyle Banerjee
  • 2,554
  • 4
  • 22
  • 30
  • Did you mean to do `&> /dev/null` in the end of the task? Also, just for clarification, your cron doesn't work even if you put the password within the cron command itself? – Anshul Goyal Nov 12 '13 at 18:18
  • Also, check this out. http://stackoverflow.com/a/6861458/1860929 – Anshul Goyal Nov 12 '13 at 18:20

1 Answers1

1

Remove last redirection

... omeka > /home/groups/omeka/database/omeka.sql

or redirect stderr

... omeka > /home/groups/omeka/database/omeka.sql 2> /dev/null
sectus
  • 15,605
  • 5
  • 55
  • 97