English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a Unix shell script program that wants to run in the foreground terminal window. It runs fine in there, but it requires that the terminal always be open.

I want to run it as a background/service application so I do not have to keep logged in.

2007-03-15 10:03:20 · 5 answers · asked by boobboo77 2 in Computers & Internet Other - Computers

5 answers

the command is

crontab -e

Look it up on the Internet on how to put an entry here to enter in a scheduled task.

RJ

2007-03-15 10:21:48 · answer #1 · answered by Anonymous · 1 1

Two things to do...

(1) You need to re-direct both the input and the output so it doesnt crash on you if it actually does require a terminal to be open while running. Typically, shorting them to /dev/nul or having some preset text files with some bogus inputs and something to grab the output may work. UNLESS the program is CURSES aware or an X-Windows or similar program - then you need to run it in a virtual x-windows windows that is not attached to a physical monitor of any kind.

(2) Add an ampersand (&) at the end of the command to make it run in the background, OR if you have superuser rights, put it into your crontab to run at specific time or times during the day.

2007-03-15 17:16:28 · answer #2 · answered by MrKnowItAll 6 · 1 0

Run the program you want running in the background like normal. Hold down ctrl+z in the terminal. This will stop the process currently running. Now type bg and hit enter. This will cause the last stopped process to run in the background.

2007-03-15 17:09:34 · answer #3 · answered by Anonymous · 1 0

Since you want to log out, you need to run:

nohup &

Background jobs tend to terminate otherwise when you logout. Run man nohup for the grisly details.

2007-03-15 17:12:52 · answer #4 · answered by Captain Curmudgeon 2 · 1 0

add an ampersand (&) to the end of the command

2007-03-15 17:07:55 · answer #5 · answered by Got Security? 6 · 1 0

fedest.com, questions and answers