I am trying to run a perpetual script (data-csv.sh) in a server over ssh. I echo the pid created to a file so to have the pid and be able to kill the process at a later stage
ssh -o StrictHostKeyChecking=no 10.0.0.1 '~/data/data-csv.sh > ~/data/
hostname.csv & echo $! > ~/data/pid.log'
The above hangs. Although in the server the process is started and the pid log is created the ssh is hanging
Even like this
ssh -o StrictHostKeyChecking=no 10.0.0.1 '~/data/data-csv.sh > ~/data/
hostname.csv &'
it still hangs.
Also the server doesn't accept -t
. The connection is closed if you try with -t
Any ideas on that?