Find the answer to your Linux question:
Results 1 to 6 of 6
Hey all, I've got a bash script that is just a flat timer without the ability to measure idle times; can anyone provide a link or compilable code that can ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! barriehie's Avatar
    Join Date
    Apr 2008
    Location
    The Desert!
    Posts
    85

    Help with Timer


    Hey all, I've got a bash script that is just a flat timer without the ability to measure idle times; can anyone provide a link or compilable code that can do this???

    TIA,
    Barrie
    Debian Squeeze 6.0.7

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Post moved here. Please refrain from hijacking or piggy backing on other threads.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3
    Just Joined! barriehie's Avatar
    Join Date
    Apr 2008
    Location
    The Desert!
    Posts
    85
    Quote Originally Posted by MikeTbob View Post
    Post moved here. Please refrain from hijacking or piggy backing on other threads.
    Sorry, wasn't my intent. My timer script is as close as I'm able to get to the original posters intent in finding an autologout routine; same thing I'm looking for.

    Thank You,
    Barrie

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Aug 2006
    Posts
    16

    Idle Timeout solution

    Quote Originally Posted by barriehie View Post
    Hey all, I've got a bash script that is just a flat timer without the ability to measure idle times; can anyone provide a link or compilable code that can do this???

    TIA,
    Barrie
    Debian Squeeze 6.0.7
    Since what you apparently want to do is log off after inactivity, why not use the bash TMOUT environment variable? Set it to the number of seconds of inactivity you want to allow before automatic logout.

    John

  6. #5
    Just Joined! barriehie's Avatar
    Join Date
    Apr 2008
    Location
    The Desert!
    Posts
    85
    Quote Originally Posted by John Rodkey View Post
    Since what you apparently want to do is log off after inactivity, why not use the bash TMOUT environment variable? Set it to the number of seconds of inactivity you want to allow before automatic logout.

    John
    Right on and thank you John, didn't know about that variable. I'll check it out when my backup is completed.

    Barrie

  7. #6
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    673
    Check out the "time" command. It is used:
    Code:
    time your_command_here that commands_arguments_here
    For example:
    Code:
    bash$ time find . -type f -print | wc -l
    17164
    
    real    0m13.046s
    user    0m0.073s
    sys     0m0.290s
    bash$ time find . -type d -print | wc -l
    6201
    
    real    0m0.076s
    user    0m0.020s
    sys     0m0.057s
    bash$

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •