Finding & fixing problem with cron

Status
Not open for further replies.

gary4gar

GaurishSharma.com
i schedule my downloads with cron, but from past few, it isn't working(no downloads). and i need to help to first find the the problem & then fixing it.

my crontab looks like

Code:
# m h  dom mon dow   command
10 2 * * * 
10 2 * * * DISPLAY=:0.0 /opt/azureus/azureus
13 2 * * * wget -ci /home/gaurish/dl-list.txt

Root's crontab
Code:
10 2 * * *  /usr/bin/pon dsl-provider
49 7 * * * /usr/bin/poff
50 7 * * * /sbin/shutdown -h 0

mail from from cron
From: Cron Daemon <root@moody-machine>
To: gaurish@moody-machine
Subject: Cron <gaurish@MOODY-MACHINE> cd /home/gaurish/scripts && sh router-reboot.sh | telnet
Date: Fri, 18 Jan 2008 02:10:05 +0530


telnet> Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.

BusyBox on localhost login: root
Password:


BusyBox v0.61.pre (2006.06.30-13:40+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

# reboot
Connection closed by foreign host.

^^^
i think its done successfully

From: Cron Daemon <root@moody-machine>
To: gaurish@moody-machine
Subject: Cron <gaurish@MOODY-MACHINE> wget -ci /home/gaurish/dl-list.txt
Date: Fri, 18 Jan 2008 02:14:00 +0530


--02:13:01-- *download-secondlife-com.s3.amazonaws.com/SecondLife_i686_1_18_5_3.tar.bz2
=> `SecondLife_i686_1_18_5_3.tar.bz2'
Resolving download-secondlife-com.s3.amazonaws.com... failed: Name or service not known.
--02:13:57-- *www.linuxcafe.org/uu/ubuntu-ultimate-1.6-dvd.iso
=> `ubuntu-ultimate-1.6-dvd.iso'
Resolving www.linuxcafe.org... 208.113.188.83
Connecting to www.linuxcafe.org|208.113.188.83|:80... failed: No route to host.


the contents of dl-list.txt file
*download-secondlife-com.s3.amazonaws.com/SecondLife_i686_1_18_5_3.tar.bz2
*www.linuxcafe.org/uu/ubuntu-ultimate-1.6-dvd.iso


the surprizeing part here is
1) cron started wget but for some reason downloads didn't start
2) azureus didn't come up & cron didn't even leave a mail behind stating what error



I am not sure whats wrong here, but the the reasons may be
1) network is was not up when wget was running.
2) some error in crontab config
3) cron deamon died
4) some unforeseen error happened:D


the script i use to reboot my router is
Code:
#!/bin/sh
#############################################
#Script Written By Gaurish Sharma                                           #
#change the password variable with your own set password         #
#the default password in most cased is 'admin'                           #
#use it in terminal as sh router-reboot.sh | telnet                       #
#(C) Gaurish Sharma 2008                                                      #
#All Right Reserved                                                               #
#############################################
add='open 192.168.1.1'
userid='root'
password='eatmypissyoublackslut'
cmd='reboot'
echo $add
sleep 1
echo $userid
sleep 1
echo $password
sleep 1
echo $cmd
sleep 1
 
Last edited:

mehulved

18 Till I Die............
As to the downloads surely it's network that's down because as the error states, it cannot find route to the host.
Also, check /var/log/messages to see if anything useful is there.
 

infra_red_dude

Wire muncher!
--02:13:01-- *download-secondlife-com.s3.am...18_5_3.tar.bz2
=> `SecondLife_i686_1_18_5_3.tar.bz2'
Resolving download-secondlife-com.s3.amazonaws.com... failed: Name or service not known.
--02:13:57-- *www.linuxcafe.org/uu/ubuntu-ultimate-1.6-dvd.iso
=> `ubuntu-ultimate-1.6-dvd.iso'
Resolving www.linuxcafe.org... 208.113.188.83
Connecting to www.linuxcafe.org|208.113.188.83|:80... failed: No route to host.
From the error looks like possibly one of the 2 errors:

1) Remote server is down
2) Problem with your ISP's DNS.

Btw, shouldn't the password='eatmypissyoublackslut' be password='drinkmypissyoublackslut' :D :))
 

mediator

Technomancer
1. check if ur DNS entries are up and running. Add opendns entries if u wish.
2. Check ur gateway entry.
3. It cud also be ur ISP => down for maintenence!
 
OP
gary4gar

gary4gar

GaurishSharma.com
here is the output of today morning, now today morning:

1) today only the router reboot script ran & other :s

From: Cron Daemon <root@moody-machine>
To: gaurish@moody-machine
Subject: Cron <gaurish@MOODY-MACHINE> cd /home/gaurish/scripts && sh router-reboot.sh | telnet
Date: Sat, 19 Jan 2008 02:10:05 +0530


telnet> Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.

BusyBox on localhost login: root
Password:


BusyBox v0.61.pre (2006.06.30-13:40+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

# reboot
Connection closed by foreign host.

wonder why the other commands didn't run:confused:

1. check if ur DNS entries are up and running. Add opendns entries if u wish.
i am using opendns+Dnsmasq
Code:
:~$ cat /etc/resolv.conf
# generated by NetworkManager, do not edit!
nameserver 127.0.0.1
nameserver 208.67.220.220
nameserver 208.67.222.222

2. Check ur gateway entry.

how to check?

It cud also be ur ISP => down for maintenence!

how come, got two days at a stretch, btw BSNL in good in terms of Uptime


1) Remote server is down
2) Problem with your ISP's DNS.
maybe, but how can you explain, tasks run run by cron & no mail left behind?


the password settings is on the based of Shocking Nonsense as Described in FAQ of PGP - Passphrase

As to the downloads surely it's network that's down because as the error states, it cannot find route to the host.
Also, check /var/log/messages to see if anything useful is there.



as my machine was restarted, so there are no logs at that time of incident:mad:
 
Last edited:

mediator

Technomancer
1. Try removing this line from resolv => "nameserver 127.0.0.1".
2. U check ur gateway with "/sbin/route -nee"! The gateway should be ur router.

Does the ping work to any of the opendns's IPs?
 
Status
Not open for further replies.
Top Bottom