How to test crontab entry?

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-06-09T20:39:46Z Indexed on 2010/06/09 20:42 UTC
Read the original article Hit count: 274

Filed under:
|
|

I have an entry in my crontab that looks like this:

0 3 * * * pg_dump mydb | gzip > ~/backup/db/$(date +%Y-%m-%d).psql.gz

That script works perfectly when I execute it from the shell, but it doesn't seem to be running every night. I'm assuming there's something wrong with the permissions, maybe crontab is running under a different user or something. How can I debug this? I'm a shared hosting environment (WebFaction).

© Stack Overflow or respective owner

Related posts about postgresql

Related posts about shell