Background Jobs and Long Tasks Print

  • 0

Running things that outlast your session.

WHAT HAPPENS WHEN YOU DISCONNECT

Processes started in your session are usually terminated.

WHY THAT MATTERS

A long migration or backup dies when your connection drops.

WHAT AN AMPERSAND DOES

Runs a command in the background of the current session.

WHY THAT IS NOT ENOUGH

It still belongs to the session.

WHAT nohup DOES

Detaches a command from the session so it survives disconnection.

WHERE ITS OUTPUT GOES

A file, unless you redirect it.

WHAT screen AND tmux PROVIDE

A session that persists on the server, which you can leave and rejoin.

WHY THEY ARE BETTER

You can return and see the output, interact, and resume after a dropped connection.

WHAT THE MINIMUM tmux COMMANDS ARE

Start a new session Detach with the prefix key then d List sessions Attach to one

WHAT THE PREFIX KEY IS BY DEFAULT

Control and b.

WHAT TO ALWAYS USE THEM FOR

Migrations Large copies Package upgrades Anything taking more than a few minutes

WHY PARTICULARLY HERE

Connections drop, and an interrupted upgrade can leave a system unbootable.

WHAT jobs, fg AND bg DO

List, foreground and background the jobs in your current shell.

WHAT TO CHECK BEFORE DISCONNECTING

Whether anything important is still attached to your session.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot