Dave's Brain

Browse - Computer Tips - How can I keep a command going after I logoff.

Date: 2014jan12
OS: Linux

Q.  How can I keep a command going after I logoff.

A.  If this happening a lot you mihgt want to formalize it and make a daemon.

Here are examples using `at` and `batch`:

echo 'sleep 2m; echo hello from batch' | batch echo 'echo hello from at' | at now + 5 minutes
Batch runs your command right away. In this example its sleeping for a period. But it could be any long-running command. Then there is nohup, disown, screen, tmux See their man pages.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.