Find the answer to your Linux question:
Results 1 to 5 of 5
I've created a script which does some monitoring and sends e-mails when various conditions are met. Trouble is it only seems to work while I am logged on - if ...
  1. #1
    Linux User stokes's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    274

    Make script run while user is not logged on

    I've created a script which does some monitoring and sends e-mails when various conditions are met. Trouble is it only seems to work while I am logged on - if I start it using "./script &" and then log off - it stops working. I also tried launching it using "nohup ./script &" ... same thing happens. I feel I am missing an easy trick here. What am I doing wrong?
    Registered Linux user #389109
    My Semi-Linux Blog

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    you could use screen to do this pretty easily, i forget the arguments to it, but its pretty easy you basically create a new "screen" in the terminal and then you can execute your script, then "detach" the screen and it will keep running in the background, you can also reopen that screen and cancel execution if you want

  3. #3
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    screen

    Awesome tool, yet so many people haven't come across it!
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  4. #4
    Linux User stokes's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    274
    Yep screen seems to do the trick, many thanks!
    Registered Linux user #389109
    My Semi-Linux Blog

  5. #5
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    nohup was invented for just this situation. man nohup for details.

Posting Permissions

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