Transferring Files from Remote Server to Remote Server Using SCP
If you have more than one server and want to transfer files between the two, you can use SCP (Secure Copy). Here is how to do it:
$ scp /folder/file-to-tranfer username@remote.host.net:/folder/file-destination-name
SCP then will ask the password for username on the remote host that already specified, insert the username and press enter. Wait until the transfer finished and your file will be copied to the destination server.
Now, if you transfer a big file, let’s say 20 GB file. You can set SCP to run in background so you don’t need to wait in front of your computer until the transfer finished. Here is how to run SCP in background:
$ scp /folder/file-to-tranfer username@remote.host.net:/folder/file-destination-name > /dev/null 2>&1
SCP then will ask for remote server username’s password, fill in the password and press enter.
Now to suspend the process press: ctrl + z
SCP will give output:
[1]+ Stopped scp /folder/file-to-tranfer username@remote.host.net:/folder/file-destination-name > /dev/null 2>&1
To make the process continued in background type command:
$ bgSCP will give output:
[1]+ scp /folder/file-to-tranfer username@remote.host.net:/folder/file-destination-name > /dev/null 2>&1 &
To see what background process that is running you can type command:
$ jobsSCP will give output:
[1]+ Running scp /folder/file-to-tranfer username@remote.host.net:/folder/file-destination-name > /dev/null 2>&1 &
To bring the process back to foreground you can use ‘fg’ command.
From network management software to antivirus firewall software, such deals should be bought from the genuine retailers. Where norton antivirus and other chat software can be downloaded from freeware sites, it will never get through the zone alarm. This is just the reason why we advise to buy wireless speakers from a reliable outlet.
June 27th, 2007 at 8:44 pm
You forgot to mention fg to make it running on foreground.
One thing i missed on scp is hash mark which will tell the progress of the overall process. Adding -v only adds verbose information about the files being added, but not the percentage
June 28th, 2007 at 1:04 am
thanks for the additional info.
i tried that command above and it shows progress percentage, the transfer rate and remaining time to accomplish the transfer. i think that is enough info for knowing the progress.
July 2nd, 2007 at 8:37 pm
hi, I tried to use scp for copying file which size is 4.2 GB. it was stopped at 4G error: file size exceeded. is that any difference when you transfer it in background? fyi, both of my server using fedora core 4.
many thanks,
&
July 2nd, 2007 at 9:16 pm
i never get that error message, are you sure that you have enough disk space on the remote server?
July 17th, 2007 at 11:48 pm
also u can use scp -q
so it wont out put anything
May 16th, 2008 at 4:07 pm
When using -r (recursive) you can get for instance an entire folder with subcontent - BUT symbolic links are not transfered ; you get the file instead. IS there a way to avoid this?
June 25th, 2008 at 7:08 am
Daniel, are you transferring the file to a fat32 filesystem?
Morfy: nope sorry