Nohup problem

Hi

I need to execute about 1000 scp commands sequential , so I made "scp.sh" - like this

scp - rp ...
scp - rp ...
............
scp - rp ...

then I run

nohup sh scp.sh &

The problem is: nohup process stopped when I closed session, or when the session expired,... Something wrong :(:(:frowning:

Can someone show me what the problem is :confused::confused::confused: and how to fix it. Thank you

I don't know for sure but it might be that scp allocates a terminal in case it needs to ask you for a password if the SSH-key authentication fails. Similar to SSH you might try to use:

scp -nqo 'BatchMode = yes' ....

I hope this helps.

bakunin

I has already configed ssh-without-password for both servers.

Up to now, I still don't know why, maybe because one server is a Vios client - I guess. I solved it by crontab. Thanks for help :):):slight_smile:

The problem is not the password-less authentification ( BatchMode=yes ) but the allocation of a pseudo-terminal by the scp -process. You can prevent that by using " -n ". You might want to test that and see if it works.

Glad, you found a solution anyhow, though.

I hope this helps.

bakunin

Hi,
may you show us the nohup.out file?

Also you may try with:

nohup sh scp.sh >scp.out 2>&1 & 

If the shell or the utility are trying to read from tty, there may be a prpblem...