Monitoring SCP connections.

Howdy All

We have a site that uploads data to us using SCP, and it is quite a large amount of data, about a 400+ meg tar.gz from Africa, so the connection is pretty slow. Our technician over there automates it so that it happens late at night for them, and theoretically it should be done in the morning... only thing is, I don't know how to verify that it HAS finished copying by the time I get into work the next day.

I have tried "netstat --protocol=inet" and "who -aHu" (at first, I didn't realise that scp didn't create a shell session...) but neither tell me. I don't know what other commands I might be able to use. Obviously, if the TAR ball hasn't finished copying, then untar'ing it at that point is no good.

Does anyone know how I might check if the connection is still open. I know the inbound IP address they will be connecting to.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Artysystem administratorCommented:
scp using sshd service for transfering files.

Transfer in progress when:
1) there is established connection from your server :22 port to remote site in africa
2) file is growing

1) netstat -an, look for local :22 port and ESTABLISHED connection state to remote site
2) if 1) shows that there is a connection, look to file size (two times, once each 5 minutes)
if file is growing - wait
if connection is not established - check file size and untar

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

Try this command:

ps aux | grep sshd

Zak_MakeWithTheFunnyAuthor Commented:
I didn't realise the --protocol=inet removed the entries for ssh...

It was right there when I dropped the --protocol=inet.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.