Trouble with Cron Job Email Notifications

Status
Not open for further replies.

Tookerder

Dabbler
Joined
Jul 10, 2015
Messages
23
I've created a cron job to update my local IP address to namecheap using the following command structure:

I've set both stdout and stderr to redirect to /dev/null

The IP address updates as expected, but I still receive an email saying "curl: not found". The subject of the email is:

Cron <nobody@freenas> PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" curl "https://dynamicdns.park-your-domain.com/update?host=@&domain=[DOMAIN]&password=[PASSWORD]&ip=`curl echoip.com`" > /dev/null 2> /dev/null
Any idea why this is happening? Would like to stop the emails without disabling my freenas email notifications. Any help is greatly appreciated!
 

Tookerder

Dabbler
Joined
Jul 10, 2015
Messages
23
Both curl commands function as expected. Inner curl returns my IP address and the outer curl makes the URL request. If I turn off stdout, I get and email with:

Code:
curl: not found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100   234  100   234    0     0    717      0 --:--:-- --:--:-- --:--:--   720
<?xml version="1.0"?><interface-response><Command>SETDNSHOST</Command><Language>eng</Language><IP>[MYIP]</IP><ErrCount>0</ErrCount><ResponseCount>0</ResponseCount><Done>true</Done><debug><![CDATA[]]></debug></interface-response>


Otherwise I just get:

Code:
curl: not found


Does that help?

Thanks.
 

Jacopx

Patron
Joined
Feb 19, 2016
Messages
367
I've created a cron job to update my local IP address to namecheap using the following command structure:

I've set both stdout and stderr to redirect to /dev/null

The IP address updates as expected, but I still receive an email saying "curl: not found". The subject of the email is:

Cron <nobody@freenas> PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" curl "https://dynamicdns.park-your-domain.com/update?host=@&domain=[DOMAIN]&password=[PASSWORD]&ip=`curl echoip.com`" > /dev/null 2> /dev/null
Any idea why this is happening? Would like to stop the emails without disabling my freenas email notifications. Any help is greatly appreciated!

I had the same problem, my cron did its jobs good but i had received the same mail... I have solved it checking the REDIRECT STDERR! :/
 

Tookerder

Dabbler
Joined
Jul 10, 2015
Messages
23
I had the same problem, my cron did its jobs good but i had received the same mail... I have solved it checking the REDIRECT STDERR! :/

Interesting. I have tried with redirect stderr and I still get the output. Thanks though.
 

Tookerder

Dabbler
Joined
Jul 10, 2015
Messages
23
I figured out the problem. I changed the inner quotes from ` to " and that did the trick. no more "curl: not found" and the IP updates automatically.
 
Status
Not open for further replies.
Top