SSH scheduled backup not working but manual run is?!

I have a SSH server running on a different port to 22 - this is the server I back up to

using server:port

When I invoke the backup manually - it works fine

But when the schedule runs it fails with the error

Failed to connect to SSH server : ssh: connect to host SERVER port xxxxx: Connection timed out

lost connection

Any ideas why this might work for one and not the other??


Hmm, I’m not sure. Is there any chance you could post a screenshot of what your Backup and Restore -> Scheduled Backup -> BACKUP screen looks like?

I’d like to see the various settings you have setup in there.


Sure see attachment

btw im using ssh key exchange for password-less login - hence no user/password

Sorry missed these bits

Okay, and just to verify – when you run the backup manually, how are you going about that?


I run it from the Scheduled backups list main screen - I click backup next to the job - then I click backup now or backup in the background


Is it possible to invoke the manual run from cron?

One last question, and we may need to get Jamie involved to look into it further…

But when you receive the error message when the backup runs – it appears to mention a server name and port number in that error message.

Is the port number it mentions correct?

Or is it reverting back to trying to use port 22?


Yep the server and port are correct in the message. I also turned on the email notification and its the same in there. Whether virtualmin is actually using that is another question.

Like I said what’s weird is the same job (same settings) when run manually, works. Just not when scheduled.

It might be worth trying running tcpdump when the backup is running to see what port it is actually using. This may be a Virtualmin bug (using the wrong port), or it may be that the network / firewall is setup differently at the time the scheduled backup runs.

Wow do I feel stupid.

I did what you said Jamie - TCPDUMP set a schedule for timenow + 1 min watched tcpdump like a hawk - and the backup went through!

I was like WTF - then realised a few months back I’d had a lot of SSH attacks - so to counteract this I had setup an allow access schedule(the backup was outside that schedule to not affect my home bandwidth) for any IP - but didn’t exclude my webserver from the range of IPs

Just to confirm it was my fault and no fault of virtualmin!