Author Topic: Running a command when I logout  (Read 551 times)

TheQuirk

  • VIP
  • Member
  • ***
  • Posts: 2,154
  • Kudos: 315
Running a command when I logout
« on: 18 December 2002, 10:25 »
I'm running "rsync" now for about 7 hours, and I want to log off (it's a remote computer). How would I make the command still be in effect? I put "rsync" to run at 11:59pm, but that's two hours away. . .

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Running a command when I logout
« Reply #1 on: 18 December 2002, 10:30 »
Are you redirecting the output of the command to a file?  If so you should be able to stop the job with a ^Z (CTRL+z) and put it into background by typing "bg". Now if the remote machine is not a linux box or not a bash shell you might have to "nohup" it.

But since it is an rsync you should be able to kill it and it should pick up where it left off when you restart it. To start it in the background you would:

$ rsync -option1 -option2 -etc > rsync.log 2>&1 &

By running it in the background you will be able to log off and it will continue to run.

[ December 18, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...