Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 18-01-2008, 01:55 PM   #1 (permalink)
GaurishSharma.com
 
gary4gar's Avatar
 
Join Date: May 2005
Location: Jaipur
Posts: 4,097
Exclamation Finding & fixing problem with cron

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
Quote:
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

Quote:
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-- http://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-- http://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

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


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 by gary4gar; 02-10-2008 at 10:05 PM.
gary4gar is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 18-01-2008, 10:13 PM   #2 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: Finding & fixing problem with cron

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.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 18-01-2008, 11:14 PM   #3 (permalink)
Wire muncher!
 
infra_red_dude's Avatar
 
Join Date: Nov 2003
Posts: 6,164
Default Re: Finding & fixing problem with cron

Quote:
--02:13:01-- http://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-- http://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'
__________________
"The true measure of a man is how he treats someone who can do him absolutely no good."

http://phoenix-ani.blogspot.com
infra_red_dude is offline  
Old 18-01-2008, 11:50 PM   #4 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: Finding & fixing problem with cron

maybe I is U and he is she
sheesh the kids these days.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 19-01-2008, 01:13 AM   #5 (permalink)
String Phreak
 
mediator's Avatar
 
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,453
Default Re: Finding & fixing problem with cron

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!
__________________
Bad Bad server.....No candy for u!
mediator is offline  
Old 19-01-2008, 10:03 AM   #6 (permalink)
GaurishSharma.com
 
gary4gar's Avatar
 
Join Date: May 2005
Location: Jaipur
Posts: 4,097
Red face Re: Finding & fixing problem with cron

here is the output of today morning, now today morning:

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

Quote:
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

Quote:
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
Quote:
2. Check ur gateway entry.
how to check?

Quote:
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


Quote:
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

Quote:
Originally Posted by mehulved View Post
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

Last edited by gary4gar; 19-01-2008 at 10:03 AM. Reason: Automerged Doublepost
gary4gar is offline  
Old 19-01-2008, 10:52 AM   #7 (permalink)
String Phreak
 
mediator's Avatar
 
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,453
Default Re: Finding & fixing problem with cron

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?
__________________
Bad Bad server.....No candy for u!
mediator is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron The Unknown Open Source 6 17-12-2007 07:18 AM
Problem in finding AV tool Kerry Software Q&A 2 30-09-2007 05:18 PM
How do I start a task through terminal using cron? unni Open Source 5 18-03-2007 07:41 PM
Cron Jobs desertwind Open Source 5 05-10-2005 11:32 AM


All times are GMT +5.5. The time now is 04:22 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2