user3066913
user3066913

Reputation:

Keep perl script running after ssh disconnect

Is there a native way to keep a perl script running on a server(uninterrupted by ssh disconnections) without the use of tools like tmux and screen ? I am using Ubuntu.

Upvotes: 0

Views: 319

Answers (2)

OmnipotentEntity
OmnipotentEntity

Reputation: 17131

You can try the POSIX command nohup

Most shells also come with disown

As far as a perl native solution, you can simply use the signal handling features of perl.

$SIG{HUP} = sub {
  print "got SIGHUP\n";
};

Upvotes: 4

slayedbylucifer
slayedbylucifer

Reputation: 23502

screen is what you are looking for.

Upvotes: 1

Related Questions