ikifar2012 / remote-backup-addon

Automatically create and backup HA snapshots using SCP
30 stars 4 forks source link

Non-issue-issue #61

Closed SirGoodenough closed 1 year ago

SirGoodenough commented 1 year ago

Since we are in a developer cycle here, I'll bring this up. Not a problem really, just think there is room for improvement. In this log, you will see that the add-on worked fine, did all it's work. The local backup happen in the HA server, but the remote device is off. It continues making the rsync and everything only to throw it out as there is nowhere to go.

Perhaps it could check if the target is alive before it does more than the local snapshot and throw a flag that the remote server is down somehow?

I don't know that this is at all feasible or even needed, just something that may enhance functionality.

s6-rc: info: service legacy-services successfully started
[info] Adding SSH key
[info] SSH key added
[warn] Creating local backup: "ChaloupkaAbode_backup 2022-08-25 06-18"
[warn] 
 Excluded folders: 
 media
---------------
[warn] 
 Excluded addons: 
 a0d7b954_plex
----------------
[info] Creating partial backup
[warn] Including --folders addons/local --folders homeassistant --folders share --folders ssl  and --addons core_samba --addons a0d7b954_ssh --addons f13797af_tasmobackup --addons core_duckdns --addons core_mosquitto --addons 3490a758_remote_backup --addons cebe7a76_hassio_google_drive_backup --addons a0d7b954_vscode --addons 45df7312_zigbee2mqtt --addons a0d7b954_zwavejs2mqtt --addons 3490a758_tdm --addons a0d7b954_zerotier 
[info] Backup created: 788715de
[info] Copying password-protected 788715de.zip to /media/off/RecoveryBuffalo/Backups/HASupervised on 192.168.108.21 using SCP
  adding: 788715de.tar (deflated 1%)
ssh: connect to host 192.168.108.21 port 22: Operation timed out

scp: Connection closed

[info] Backup copied to /media/off/RecoveryBuffalo/Backups/HASupervised/788715de.zip on 192.168.108.21
[info] Renaming 788715de.zip to ChaloupkaAbode_backup 2022-08-25 06-18.zip
ssh: connect to host 192.168.108.21 port 22: Operation timed out

s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
patman15 commented 1 year ago

You can try the dev branch, I fixed that with https://github.com/ikifar2012/remote-backup-addon/pull/59 Behaviour is now that it generates the backup (so that you at least have a local one) and then tries to copy the files to the remote host using the enabled protocols. In case there is success the backup(s) are deleted according to your settings. Copying and renaming are now just one step.