SCP timeout delay?

601 views Asked by At

So im doing an scp from a raspberry pi to my computer, which is set to wake for internet requests, but it takes time to wake, Ive tested this by sshing into my computer from my phone, while my computer was closed, and it took a while (5-10 seconds) but worked. The problem is the pi scp requests time out before the comptuer wakes. The scp is run in a .sh script triggered by cron. How to I change the timeout time for scp? Any help would be appreciated!

1

There are 1 answers

0
IBam On BEST ANSWER

Use the ConnectTimeout option:

scp -o ConnectTimeout=20 /myfile.txt user@host:/myfile.txt

If that still doesn't work, try using ConnectionAttempts=2 (or higher) option, which will retry if the first one times out.