Reputation: 2496
I don't know why my cronjob doesn't run the way I expect. I added the following line to crontab -e
.
* * * * * /home/cookiemon/test.sh
This script is executable and simply appends current time to output.txt
#!/bin/sh
date >> output.txt
It seems that this script is running correctly when I check the log at /var/log/syslog
. However, the output.txt file is never created. I tried this with sudo crontab -e
, but the result was exactly the same. What am I doing wrong?
FYI, I am using Debian Wheezy.
Upvotes: 0
Views: 187
Reputation: 123608
However, the output.txt file is never created.
The script is producing the output at a location where you don't have write access.
Specify the complete path to the log.
#!/bin/sh
date >> /home/cookiemon/output.txt
Upvotes: 1