2

I need to transfer a large number of files over SFTP (only between Solaris servers) which takes a very long time. I cannot keep my PC on for this duration. I tried:

nohup sftp server1

While the shell is open, I see files are downloaded. When I close the shell it stops. In ps -ef I don't see the sftp process. The file nohup.out states: Killed by signal 15

If instead I do ctrl-z, bg, disown it works. However this requires the bash shell. I'd prefer a solution for ksh.

Thanks.

anurag kohli
  • 57
  • 1
  • 2
  • 7

4 Answers4

3
  • Start your sftp session as usual: sftp server1
  • Put it in the background with Ctrl+Z
  • Disconnect it from its parent with nohup -ga $(pgrep sftp)
jlliagre
  • 8,691
  • 16
  • 36
1

Sounds like a perfect task for GNU Screen.

EEAA
  • 108,414
  • 18
  • 172
  • 242
0

I don't use KSH myself, but have you tried:

nohup sftp server1 &
Tok
  • 391
  • 1
  • 3
0

Could you not use scp in a script ? This is non-interactive and therefore doesnt require a terminal, and will work fine with nohup.

Chris T
  • 76
  • 1
  • Chris, I could look into this. However I don't have root access to this particular server so not sure if this is viable. – anurag kohli Nov 30 '10 at 21:28