Script goes to the remote server and runs a shell script “snap.sh” using Net::SSH::Perl.
This shell script takes almost 10mins to end, and my perl program waits until it gets output.
I want to run the shell script on the remote sever and the program should close the SSH session without waiting for the script to finishes on the remote server.
my $ssh = Net::SSH::Perl->new($host, protocol =>2);
$ssh->login($username, $password);
my $cmd="./bin/snap.sh";
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
Untested, but can’t you just do what
ssh -fdoes?