Use of screen in running background jobs and how to use this

Hello,

Please advise use of screen in running jobs in nohup background and how to use this

Best regards,
Vishal

Install via rpm, its helpful to edit/create a screenrc (either in /etc/screenrc of ~/.screenrc)

simple screenrc:

------------------------------------------------
# no default message, no audible bell
startup_message off
vbell on
 

# more usable scrollback
defscrollback 5000
 

# detach on hangup
autodetach on

 

# make bold work
#attrcolor b ".I"

#attrcolor i "+b"

 

# hardstatus and caption
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "

 

 

# resize
bind + resize +5
bind - resize -5
bind = resize =

 

# bindings
bind % screen -t top top

read the MAN so you know how to reattach disconnected sessions, etc. Basic key bindings start with Ctrl-a then the key-combo you want to send to screen (ex, Ctrl-a then ctrl+c will create a new psuedo terminal, Ctrl+a then Ctrl+A will allow you to name the new terminal something useful in the statusbar)
screen is useful as it grabs the hup message, if you get disconnected from your session your psuedo terms will still be running so your programs don't get the hup and continue to run.

helpful args for this -
screen -ls
screen -rd "session-name" = reconnect the session and disconnect it from elsewhere if needed.