Help me learn to understand Tomato system info

Discussion in 'Tomato Firmware' started by ImGeo, Dec 14, 2009.

  1. ImGeo

    ImGeo Addicted to LI Member

    Is there some kind of guide to help me understand the more technical and unix-based part of tomato?

    For example, learn about how to write cron jobs, understand logs, etc.

    Also, what does this mean? It's the output of "cru l"

    7 21 * * * ntpsync --cron #ntpsync#
    */15 * * * * rcheck --cron #rcheck#
  2. jan.n

    jan.n LI Guru Member

    Hello ImGeo,

    Tomato is based on Linux and there are lots of places on the internet where you can learn about Linux in general, IMHO you best get to know Linux while using it on a "play machine". Get yourself an older and unused computer, install a distribution of your choice and then play around with it. Using a dedicated "playground" machine is better than using your router, because the latter is more important for you (as it provides your internet connection).

    Then google for the stuff that's of intereset for you, say "cronjob linux" or the like, and then read, learn and try.
    Of course you can always ask your questions here, too.

    "cru l" on a tomato system is quite similar to "crontab -l" on a "normal" linux box.
    It lists the existing crontab of the currently logged on user.
    The output you see means that
    1) the command "ntpsync --cron #ntpsync#" is run at 21:07 every day
    2) The command "rcheck --cron #rcheck#" is run every 15 minutes
    The syntax is like this:
    .---------------- minute (0 - 59) 
    |  .------------- hour (0 - 23)
    |  |  .---------- day of month (1 - 31)
    |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ... 
    |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)  OR sun,mon,tue,wed,thu,fri,sat 
    |  |  |  |  |
    *  *  *  *  *  command to be executed
    The #...# enclosed text at the end of the commands are actually labels that are used by the cru command.

    Now you know that your router runs two commands via cron. To find out what these commands actually _do_, try to google them with the additional keyword "tomato", i.e. "ntpsync tomato".

    If you have more questions, don't hesitate to ask!
  3. lanmtl

    lanmtl Addicted to LI Member

    I am having trouble with this one:
    1 */12 * * * /tmp/backup-rstats #rstats#
    Would it mean it's run every hour past one minute every twelve hours? It doesn't make sense, does it?
  4. karogyoker

    karogyoker Addicted to LI Member

    It does that.
  5. TexasFlood

    TexasFlood Network Guru Member

    Believe that in cron terms this means that it runs one minute past the hour every 12 hours, so like one minute after midnight and one minute after noon. I have some scripts that are schedule slightly off an hour like that, sometimes you have something that runs at the top of the hour and want another script to run right after so might schedule it for one minute after.
  6. lanmtl

    lanmtl Addicted to LI Member

    Thanks for the explanations!
  7. Toastman

    Toastman Super Moderator Staff Member Member

    Searching Google for "Linux" returns 301,000,000 hits. There must be more help available for Linux than anything on the planet.
  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