Problem with remote backups

I’ve a HestiaCP v1.8.11 running in a VPS, and I’ve configured a remote SFTP backup.
What I’ve noticed is that, in case that the remote server is down or not reachable (router down, etc.), it looks like the remote backup is running forever, until it is able to perform the backup, increasing the server load considerably.

Is this a bug or a configuration problem?
Is there any way to set a timeout and in case the backup does not succeed, then Hestia sends a message to the administrator?

Thank you

Would like to know the answer too since i use remote backups as well

Hello
$HESTIA/bin/v-backup-user calls the bash function sftpc from the file $HESTIA/func/backup.sh

It appears it should fail if it cant make a connection ( server down or unreachable, etc).

if you think it is getting stalled you could create a ~/.ssh/config and set different timeouts. Not sure which user it runs this script runs as ,specifially the expect script for sftp connection. someone will have to chime in here about that. My guess would be root

as far as the settings they are covered here.
https://man7.org/linux/man-pages/man5/ssh_config.5.html

if it was me I’d start with these settings from here

 ServerAliveInterval 20
  ServerAliveCountMax 5
  ConnectTimeout 10

I didnt test any of this . YMMV