LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   running jobs on the background (https://www.linuxquestions.org/questions/linux-software-2/running-jobs-on-the-background-349199/)

feetyouwell 08-02-2005 08:58 AM

running jobs on the background
 
I've got a question, i normally ssh to different computational servers here to run my jobs, i have a job now it will run estimately for 6 days, normally if i open up a terminal and ran anything off the server, the process will be terminated as well as I end the session, some of my friends suggested using "at" to run job at a scheduled time, well i am lazy to learn how to use "at", is there any other easier way? (& won't work, have tried)

druuna 08-02-2005 09:27 AM

Hi,

Take a look at nohup.
This runs a command, immune to hangups, with output to a non-tty.

Hope this helps.

feetyouwell 08-02-2005 10:13 AM

thanks for the answer, i will give it a try sometimes,
my friend actually came to help me out with "at"
simply
Code:

at -s -f <shell_script_to_call_my_job> now
and it worked beautifully

druuna 08-02-2005 10:36 AM

Hi,

It's nice to read you got it working.

Do give nohup a try, it's easier then at (nohup <script>).

techjaymindave 09-07-2019 02:42 PM

SCREEN - Background tool
 
Good day Team,

I had similar question and I had to find a work around where I found screen option.

This is a package installed in Centos by default.

You can launch a background screen, and minimize it on CLI and restore it back when you want to...

Make sure that you don't exit the ScreenSession anytime. Otherwise, you won't be able to get it back.

To Launch
screen -dmS (NAMETHATYOUCANREMEMBER)
To minimuze this screen for retriving it later, press ALT+A D
To retrieve to same screen again, simply type
screen -r (NAMETHATYOUMENTIONEDEARLIER)

This is helping me to run processes in background and take a look over it later.

Hope this helps.

Firerat 09-07-2019 03:13 PM

yeap I favour screen

alternative is tmux ( essentially the same as screen )

an alternative to the nohup answer give way back in 2005 is coproc

which didn't arrive until bash version 4

more detail here
https://wiki-dev.bash-hackers.org/sy...eywords/coproc


All times are GMT -5. The time now is 08:31 PM.