Question

  • I have huge file to transfer from one server to another server.
  • Im using sftp mode and using command eg: "sftp>put file.txt"
  • Question : how do i run the command in nohup so that i can close my sftp session without killing the transfer process.
Was it helpful?

Solution 2

echo "put file.txt" | sftp -b - servername &

If I understand you correctly.

OTHER TIPS

  echo "put file.txt" | sftp username@hostname
  ctrl-z
  bg
  disown

Nohup doesn't work with sftp, if you close the shell , it will kill the process. Just put the command to run in crontab, process will continue, even you close all shells.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top