Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Cron is making me insane


  • Please log in to reply
1 reply to this topic

#1 thejestre

thejestre

  • Members
  • 25 posts
  • OFFLINE
  •  
  • Local time:04:42 PM

Posted 11 May 2011 - 12:52 PM

I'll keep this short, I jut want to wget a URL every 10 minutes as root. I have full root access, it is running FreeNAS .7 which is built off of FreeBSD.

Here is /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour    mday    month   wday    who     command
#
# Perform email status report.
7 0,1,12,13 * * * root /etc/mail/sendreport
0,10,20,30,40,50 * * * * root /root/trac.sh

The first cron job is working fine, it's trac.sh that I can't get to cooperate.

Here are the file permissions for it:
-rwxrwxr-- 1 root wheel 157 May 10 23:54 trac.sh

Here is trac.sh
#!/bin/sh
wget -o /root/wgeterr.txt -O /root/trac.html http://example.com/index.php
date > /root/date.txt

The aggravating part is that the 'date > /root/date.txt' part works every 10 minutes but the wget does not. Index.php inserts a record into a database table every time it is accessed so I have 2 reasons to believe the wget line isn't firing. It must be something simple I'm not seeing...

Thanks in advance,

_theJestre

BC AdBot (Login to Remove)

 


#2 thejestre

thejestre
  • Topic Starter

  • Members
  • 25 posts
  • OFFLINE
  •  
  • Local time:04:42 PM

Posted 15 May 2011 - 08:41 PM

Found the problem, I think.

When I put the full path to wget, it works.

Thanks anyway,

_theJestre




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users