crontab and network interface restart

109 views
Skip to first unread message

bartosz

unread,
Dec 10, 2014, 9:14:49 PM12/10/14
to grase-...@grasehotspot.org
Hi guys,

i am having some small issue with my hotspot, as I thought it will be good to have small server i bough Intel next unit of computing, as it comes with one ethernet, i bought usb one for lan. so from time to time networks freez every couple few days. ( i know i will never buy usb card again :)))))

so i am trying to find out is it usb card get funny, so what ive done is:

from root ive run crontab -e to restart network interfaces every 12h

5 * * * * root /home/networkreset.sh >> /home/network.txt
(its 5 min just to try is it working)

/home/networkreset.sh
/etc/init.d/networking restart

in logs show:
Dec 11 02:02:01 harrys CRON[5756]: (root) CMD (root /home/networkreset.sh >> /home/network.txt)

so its working but in file: 
/home/network.txt is empty :(

HOW TO CHECK IS MY INTERFACE RESTART WORKS?




Timothy White

unread,
Dec 11, 2014, 3:36:49 AM12/11/14
to grase-...@grasehotspot.org
I would take off the >> /home/network.txt and ensure you have mail setup, as then Cron will capture the output and email it to you.

Alternatively, you need to ensure you catch both stderr and stdout, by default you are just capturing stdout.


Having said all that, you'll probably find that restarting networking won't fix a faulty card, as often its a card lockup which needs the usb to be reset (unplugged and plugged back in)

Tim

--
This mailing list is for the Grase Hotspot Project http://grasehotspot.org
---
You received this message because you are subscribed to the Google Groups "Grase Hotspot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grase-hotspo...@grasehotspot.org.
To post to this group, send email to grase-...@grasehotspot.org.
Visit this group at http://groups.google.com/a/grasehotspot.org/group/grase-hotspot/.
To view this discussion on the web visit https://groups.google.com/a/grasehotspot.org/d/msgid/grase-hotspot/1a88193c-06c5-4934-b60f-55ae6fd74f7c%40grasehotspot.org.

Reply all
Reply to author
Forward
0 new messages