As a Linux Admin or DBA, we may often face the issue of copying a larger file from one host to another using scp. Sometimes, our connection may be lost or interrupted due to various reasons. To resolve this, we can use nohup (no hang-up). It allows the process to run in the background even if you close your terminal. Today in this article, we will discuss on this how to run scp in background with nohup :
How to run scp in Background with nohup :
Issue the below command to run scp in background :
nohup scp username@hostname:/source_path/file_name /target_path >log_name 2>&1 &
Example :
nohup scp oracle@test:/redo/test_1.arc /redo1/arc >output.log 2>&1 &
Here, 2>&1
: Redirects the standard error (stderr) to the same output.log
file.
Hope this helps!! Also, you can get more information from the below link as well :
Using SCP and nohup to transfer large folder between servers
Related Oracle Articles :
- Nohup sqlplus command in Oracle : Easy Guide
- How to Relink Binaries in Oracle : Easy Guide in 7 Steps