Cron is running but not outputting data
Posted
by
Youri
on Ask Ubuntu
See other posts from Ask Ubuntu
or by Youri
Published on 2013-10-22T09:16:30Z
Indexed on
2013/10/22
10:14 UTC
Read the original article
Hit count: 293
I'm trying to make my Amazon EC2 instances stop and start by a crontab. EC2 Api tools is succesfully installed. Manually it works.
The cron (which I put in with the command crontab -e): 10 * * * * ubuntu /usr/bin/ec2-stop-instances [instanceid] > /tmp/ec2.log
The file /tmp/ec2.log is created. When I use the command grep CRON /var/log/syslog I see the cron has actually run. I don't get any output in the /tmp/ec2.log file though. I have set all the amazon variables needed.
Even if I on purpose create a wrong cron, like this: 10 * * * * ubuntu /usr/bin/ec2-stop-instancwweqes [instanceid] > /tmp/ec2.log
I get no output in the file. Shouldn't there be an error? I also tried not defining the user: 10 * * * * /usr/bin/ec2-stop-instances [instanceid] > /tmp/ec2.log
And direct command: 10 * * * * ubuntu ec2-stop-instances [instanceid] > /tmp/ec2.log
Can someone please help me. If I can somehow debug, I can get to the solution.
Thanks in advance.
© Ask Ubuntu or respective owner