Transfer files run in SCP background under Linux
Sometimes the files we need to copy by SCP are so large that we can't wait all the time, so how do we make SCP run in the background?
Here is a simple method:
1. Run SCP command
[root@test dpdir] # nohup scp OUTDB_ERR??.dmp oracle@192.168.1.133:/oradir
2. Enter the password
Nohup: appending output to nohup.out
Oracle@ 192.168. 1.133s password:
At this time, the process of entering the password will be suspended, or will it run in the foreground?
3. Enter the ctrl+z pause program
The following prompt appears:
[1] + Stopped nohup scp OUTDB_ERR??.dmp oracle@192.168.1.133:/oradir
4. Execute bg to keep the process running in the background
[root@test dpdir] # bg
[1] + nohup scp OUTDB_ERR??.dmp oracle@192.168.1.133:/oradir &
[root@test dpdir] #
This 4 steps will enable SCP to run in the background and be done.
The output log of the whole process is like this, for reference only.
Operation log for reference!
[root@test dpdir] # nohup scp OUTDB_ERR??.dmp oracle@192.168.1.133:/oradirnohup: appending output to nohup.outoracle@192.168.1.133's password: [1] + Stopped nohup scp OUTDB_ERR??.dmp oracle@192.168.1.133:/oradir [root@test dpdir] # [root@test dpdir] # bg [1] + nohup scp OUTDB_ERR??.dmp oracle@192.168.1.133:/oradir & [root@test dpdir] #