• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

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
0
Zak_MakeWithTheFunny
Asked:
Zak_MakeWithTheFunny
1 Solution
 
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now