Cron job not running shell script

So, I have made a backup.sh script that is supposed to run every hour but it doesn't. When I run it directly ./backup.sh then it works fine.

I created the script using user "myname" and he is the owner of this file. I setup cron job as:

sudo crontab -e
0 * * * * /var/www/mysite/backup.sh

But when I run this command:
crontab -e

Then it opens a blank file. It seems when I use sudo then it opens root cron file and when I run it without sudo then it opens myname cron file. May be this is the issue?

Or may be cron is trying to run but there is an error? How do I check that error?

Comments

Sign In or Register to comment.