I have a script on a mac mini server that slowly downloads a multi-gigabyte file. I would like to launch this script via SSH from another (linux) server with ssh mac-server 'nohup /path/to/script arguments'
but immediately kill the SSH connection as soon as I know that the script has been successfully launched. Once it is launched, the SSH connection doesn't serve any useful purpose, systematically fails somewhere during the downloads, and blocks the execution on the linux server.
I can't just do ssh -f
or ssh &
because I need the command to fail on the linux server if the script doesn't launch (or if the mac is not reachable).