UBUNTU: why my crontab isn’t running the code?
Hi all
I’ve configured manually the /etc/crontab to add an event that runs on day 9 every months…
The Cron is running, but it didn’t runned my code yet…
My code is at the last line:
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
23 9 9 * * root wget "http://www.mysite.com/url.api?dowhat=mensalcheck" --no-cache --read-timeout=1600 -O "/var/log/mysite.com/$(date "+url-api.%d-%m-%y.log")"
To make sure your cron is run, use “crontab -e” or “sudo crontab -e” to edit your cron jobs. Then when you’re done editing and saved the file, crontab will install the new cronjob properly to be executed the next time.
So, use sudo crontab -e and make sure you at least do one modification to the file.
Also cron usually has no PATH variable, meaning it does know where to find wget, so the best is to put /usr/bin/wget.
Check more discussion of this question.
Related posts:
Leave a comment
Recent Posts
Tags
active-directory
amazon-ec2
apache
apache2
backup
bash
centos
cisco
command-line
debian
dns
email
exchange
firewall
iis
iis7
iptables
linux
macosx
monitoring
mysql
networking
nginx
performance
permissions
php
postfix
raid
security
sql-server
sql-server-2005
sql-server-2008
ssh
ssl
ubuntu
unix
virtualization
vpn
webserver
windows
windows-7
windows-server-2003
windows-server-2008
windows-server-2008-r2
windows-xp





