3

I want to run the following rsync command to transfer a folder from a remote server to my current one sudo -r -a -v -e 'ssh -p portnum' username@serverip:/home/path/* /home/path this directory is quite large in both size and structure and the transfer takes some time. Rather than leave my computer turned on with the PuTTY window open, I would like to run a command that continues to execute after I have closed the window and shut down my PC.

I have tried using prefixing it with nohup but it didn't work. What other options do I have?

Euskadi
  • 195
  • 1
  • 1
  • 7

2 Answers2

10

Run the command within GNU Screen. Basically:

  1. Install screen: $ sudo apt-get install screen
  2. Run screen: $ screen ... at which point, you'll have a shell running from within screen.
  3. Run your command.
  4. Press Ctrl-A,d, which will detach you from the screen session and your command will continue running.

When you want to re-attach, just ssh in as the user who owns the screen session and then:

$ screen -RD
EEAA
  • 108,414
  • 18
  • 172
  • 242
0

you could install and run a program like screen, or throw that command in a bash script and run it on cron one time.

Drew Khoury
  • 4,569
  • 8
  • 26
  • 28