1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CRON job Turn off router at specified time every day?

Discussion in 'Tomato Firmware' started by pmuch12345, Sep 12, 2008.

  1. pmuch12345

    pmuch12345 Addicted to LI Member


    I am using the most recent version of Tomato (1.21).

    I want to setup a CRON job to turn off my router
    everyday at a specified time, i.e. 1am.

    What is the "cru" command to perform this task?
    Which script should I place the command in? Startup?

  2. TexasFlood

    TexasFlood Network Guru Member

    cru a NightHaltRouter "0 1 * * * /sbin/halt"
  3. mraneri

    mraneri LI Guru Member

    How useful is this? I suspect the router is still "ON" just the CPU isn't doing anything anymore. How would one restart it? Pull the plug and plug it back in is probably the only way, no?

    Why would one want to "lock up" the router this way?

    - Mike
  4. TexasFlood

    TexasFlood Network Guru Member

    I don't know what pmuch12345 has in mind but the last time this came up, it was to avoid ISP charges.
  5. fyellin

    fyellin LI Guru Member

    Out of curiousity. "Access Restrictions" lets you limit all computers from having access to the WAN during certain hours. Is this a simpler way of avoiding ISP charges? Will this also prevent Tomato, itself, from accessing the WAN?
  6. Mastec

    Mastec Network Guru Member

    Access restrictions work for me when kids don't want to go to bed on a school night. Wan is off at 10pm and back on at 5:30am. No need for cron or scripts.
  7. TexasFlood

    TexasFlood Network Guru Member

    Same approach works for me as well. All depends on what you're trying to do.
  8. pmuch12345

    pmuch12345 Addicted to LI Member

    Wanted to (hopefully) increase router longevity!

    Thanks to all for your help!!

    I wanted to shutdown the router when not used overnight to keep the router from running all of the time and hopefully increase its longevity.

  9. mraneri

    mraneri LI Guru Member

    "Halt"ing the router in this manner is not likely to help, unfortunately. The router is most likely to die when it's destined to die!! Actually, while, of course, there are some cases of routers dying of natural causes, I would suspect a few routers die as a result of external stresses.. i.e. being dropped, and/or power spikes on the supply line or one of the LAN/WAN ports. I believe, MOST routers die of obsolescence. My first router "died" because it didn't have wireless. My second router "died" because d-Link couldn't get the firmware right, it crashed all the time, and I finally got fed up with it. My third router is now 3 or so years old and going strong. It will probably die when I get the itch for an "N" router, or for an integrated GB Switch with more ports, or somethiing like that.

    Anyway, if one wants to "halt" the router, feel free, but I believe the CPU will still be receiving power, and all of the components will still be "on".

    - Mike
  10. rhester72

    rhester72 Network Guru Member

    Bear in mind that most devices fail due to power surges and heat-related contraction/expansion caused *by* repeated power-ups and power-downs...it's actually safer (particularly with solid-state equipment with no moving parts) to keep the device powered up 24/7.

  11. kevanj

    kevanj LI Guru Member

    There are arguments on both sides of this fence...some will argue that powering down and up again can put more stress on an electronic device that just leavng it running...as long as it's not overheating.

    This is probably going to start a long and argumentative thread... :)

    I don't know the answer, all I know is that my Buffalo has been up for nigh on 2 years with only downtimes for firmware flashes, and I have a WRT54gv2 that has been up longer that that, but lost it's WAN port in a lightening storm...otherwise it has been a rock (using it as a wireless gateway for WAP only devices). They are both on a battery backup/surge protector, so that may be a contributing factor to their long lives.....
  12. Mastec

    Mastec Network Guru Member

    One thing to add and it's the obvious. If you look at your router there is no on/off switch which pretty much tells a person that it's a 24/7 powered on piece of hardware. I also agree with rhester72... My buffalo was on for nearly 2 years before it crashed, but brought back to life. Has been on ever since. My WRT54Gv3 has been online for nearly 3 years. Both online of course except for the occasional power outages due to storms
  13. mraneri

    mraneri LI Guru Member

    Yes and no... it's a 24/7 piece of hardware because most people want it on, at the ready, all the time, and they don't use THAT much power. There's no switch, because MOST people wouldn't use the switch, and it saves the manufacturer something like 10 cents per router.

    All that being said, this discussion regarding electronics reliability is irrelevant to the original poster's question, because, the halt command doesn't actually turn anything off. So, there's no power savings (i.e. electric bill), and no thermal cycling, which is what causes stuff to die early (not typically the power spikes from turn-on/turn-off, but actually the thermal expansion/contraction from the associated heating and cooling as the stuff self heats.)

    So, unless you want to hook up some inline timer between the outlet and the wall-brick, you're not likely to realize any logevity savings by issuing the "halt" command on the router. If you DO decide to use a timer on the mains, I don't suspect you will help or hurt the reliability. I would recommend you don't bother.
  14. GhaladReam

    GhaladReam Network Guru Member

    My WRT54GS v2.0 is pushing 4 years, with the only downtime being firmware updates. It's still working just as well as the day I bought it... Actually, the day I bought it, it didn't have Tomato on it, so I suppose you could say it works BETTER ;)
  15. rizsher

    rizsher Network Guru Member

Share This Page