Or you can automate it by scheduling a job in windows to do it every day (assuming you have an automation in HA that creates a snapshot every night)
@echo off REM --- Robocopy REM -------- REM REM --- Copy Home Assistant Snapshots and config folder to OneDrive REM REM --- Parameters used: REM REM --- /MIR : MIRror a directory tree REM REM --- /DST : Compensate for DST time differences REM REM --- /XD : eXclude Directories REM REM --- /XF : eXclude Files echo ==================================================================== echo COPYING - Home Assistant Snapshots echo ==================================================================== echo. echo === echo === Mapping to HASSIO... echo === echo. net use x: \\192.168.1.25\backup x: echo. echo === echo === Deleting old snapshots (matching *.tar) on echo === HASSIO that are older than 8 days... echo === echo. forfiles /m *.tar /d -8 /c "cmd /c del @file" echo. echo === echo === Robocopy new snapshots on HASSIO to echo === OneDrive folder on PC... echo === echo. robocopy "\\192.168.1.25\backup" "D:\Users\USERNAME\OneDrive\Home Assistant Backups" echo. echo === echo === Deleting old snapshots from OneDrive folder echo === on PC that are older than 14 days... echo === echo. forfiles /m *.tar /p "D:\Users\USERNAME\OneDrive\Home Assistant Backups" /d -14 /c "cmd /c del @file" echo. echo === echo === Robocopy current HASSIO config folder echo === to OneDrive folder on PC... echo === echo. robocopy "\\192.168.1.25\config" "D:\Users\USERNAME\OneDrive\Home Assistant Backups\Latest config" /MIR /DST /XF *.db *.log /XD deps tts .* echo. echo === echo === List current snapshots on HASSIO... echo === echo. dir x: /o:-d /a:-d pause echo. echo === echo === List current snapshots in OneDrive folder on PC... echo === echo. dir "D:\Users\USERNAME\OneDrive\Home Assistant Backups" /o:-d /a:-d pause REM --- Remove drive mapping REM --- net use x: /delete /y
It’s funny… my automation has stopped working 2 nights ago and I have no idea why. It still creates the snapshot but doesn’t upload it. I did just run the automation manually and it worked perfectly… Reall odd as it’s one automation that creates the snapshot, waits an hour and uploads it… and the automation is ON.
I have no idea why it’s just now screwed the pooch.
And today it works… I did change a few things around in dropbox as it was getting full but no reason that would have caused this… (the notifications weren’t getting activated either for that automation. Maybe 0.87.1 fixed it?
Simply click on the snapshot you want to copy in the Hass.io Snapshots menu .In the bottom corner next to bin icon is a download icon . Download to your PC and keep it safe
FWIW - I gave up and recently came back. I gave up because the pi was underpowered, SD cards died all the time, and HA updates constantly broke compatibility. So I switched to smartthings. In the end, it was too limiting. I got myself a used intel NUC, loaded hassio, and HA runs great. Now the updates can still break compatibility, but that’s what backups are for!
Ah. I now have HA, so no more snapshots…