How to run scp in background after logging out session ?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to run scp in background after logging out session ?
Hello,
I am trying to transfer files from old remote server to new remote server using scp command
The scp command which works for me is
scp -r root@ipaddress:/home/admin/www www
It ask me for password and i enter password and it starts uploading files from old remote server to new remote server which i can see but i have files over 45gb so i don't want to see each and every file transferring by looking at putty.
I heard scp can run in background so after exiting session from new server or exiting putty the background works.
What i did to work scp command in background is :
scp -r root@ipaddress:/home/admin/www www
after the upload starts cntrl + Z then type [bg] it runs in background which i can see by typing [jobs] then i type [exit] and putty closes then i relogged in again to new server from where i use scp command to see if my job in background is running by typing [jobs] but it didn't show any background processing jobs.
command.
Place the command/s that you wish to be executed in a script - let's call it "xx". Mark the script as executable. Then
Code:
nohup ./xx &
Note the ampersand (&) to place the command in the background.
Now when you logout - the "hangup signal SIGHUP" will be ignored by all of the commands running beneath nohup.
As a "bonus" - you can return later and examine any of the output by viewing "nohup.out".
Again, this forum doesn't work like that. I suggest you remove your email addresses, unless you want spam (not from LQ members, but from bots that will harvest them).
Again, what exactly is the problem using Screen? You just run "screen" at the terminal, then run your scp command and use "Ctrl-a d" to detach the Screen session and you can log out. When you log in, you can run "screen -r" to reattach the session.
i am newbie in ssh, i have come to linuxquestions to receive support from linux addicts. Please its matter of only running scp command in background can you please login to my computer using teamviewer and put the command to work....please.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.