Wednesday, February 8, 2012

scp as a background process

scp as a background process « Kunal Bharati
scp as a background process

To execute any linux command in background we use nohup as follows:

1 $ nohup SOME_COMMAND &

But the problem with scp command is that it prompts for the password (if password authentication is used). So to make scp execute as a background process do this:

1 $ nohup scp file_to_copy user@server:/path/to/copy/the/file > nohup.out 2>&1

Then press ctrl + z which will temporarily suspend the command, then enter the command:

1 $ bg

This will start executing the command in backgroud
Advertisement
Share this:

Share

Like this:
Like
Be the first to like this post.

Tags: Linux, tips n tricks


No comments:

Post a Comment