Is it possible to:
- execute sftp command on remote machine and download a file (
ssh user@machine
,sftp user2@server
,get file
) - then, send download to background, so I can turn my local computer off
Is it possible to:
ssh user@machine
, sftp user2@server
, get file
)
Try
screen
on machine B, start the download and detach afterwards:On machine A:
ssh user@B
On machine B:
Never tried but could work.
Edit: later, log back in and use
screen -x
to reconnect to the running session. Then, shut it down properly so that it isn't consuming the server's resources.If you just want the "detach" feature of screen, there's a program called "dtach" that provides only that feature.
Putting the character & (ampersand) behind a command runs it in background. However, I don't know how to do it after a command has already been executed, nor do I know whether this works on remote machines.
There are a number of solutions to this issue.
One option is to use the
screen
command, however seems a little complex.The best way I have found is sending the job to the background.
In your case the command would be