One time job scheduling

Discussion in 'Tomato Firmware' started by NoFace, Aug 18, 2008.

  1. NoFace

    NoFace Addicted to LI Member

    Hi, I am running Tomato 1.21 on my Linksys WRT54GL.

    I am fairly new to linux in general, and I was wondering how I would schedule a job for execution once only from the terminal. I understand that on most linux distributions I would be able to do this with the "at" command, but that does not seem to be the case with this firmware. I have looked at "cru" but it seems this is for repeating cron jobs only.

    Any help on this matter would be greatly appreciated.
  2. TexasFlood

    TexasFlood Network Guru Member

    If you look at the cru help, you will see:

    add: cru a <unique id> <"min hour day month week command">

    The latter part of the command is really just standard cron format.

    While you're right that cron jobs are repeating in nature, the interval can be from every minute to every year. If you specify not only time but also the month and day of month, this is practically the same as a running it once.

    Your router would have to stay up a year without losing power or rebooting for such a cron entry to repeat. I don't know about your router(s) but my routers have never been up a year or are ever likely to. Even in the seemingly unlikely event of power & firmware both remaining stable for a year, I'd reboot it myself for some reason. And any cron entries added from the command line will be gone when the router reboots.
  3. PeterT

    PeterT Network Guru Member

    You could also add into your scheduled script another call to cru to remove it's entry....
  4. NoFace

    NoFace Addicted to LI Member

    Thank you both for your fast responses. I have gone with PeterT's suggestion and it is working great. The solution seems so obvious now, I'm embarrassed that I mananged to miss it. :tongue:

    Thank you very much for the help.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice