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.

Cheers
Zak
Zak_MakeWithTheFunnyAsked:
Who is Participating?
 
NopiusCommented:
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
AND
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
0
 
ppfoongCommented:

Try this command:

ps aux | grep sshd


0
 
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.

Cheers,
Zak
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.