Low-Frequency / Klipper-Git-Backup

Fully automated klipper backups
119 stars 26 forks source link

Moonraker DB Backup? #34

Open 5teveO opened 4 weeks ago

5teveO commented 4 weeks ago

Just wondering if the moonraker DB can be backed up as standard folder add or if moonraker needs to be stopped to do it?

Thanks again for v2 - i have just installed it to a new machine and it seems to have worked well.

Just a small comment - is it possible to exclude linked files (im not good with terminology)- eg the fluidd.cfg or mainsail.cfg - same with the KAMP folder..

Low-Frequency commented 2 weeks ago

Since Moonraker uses sqlite, a backup would be really simple. No need to dump the database, it's just copying the file from directory A to directory B, so it's pretty simple to implement.

Regarding KAMP I have no idea how this works or is set up since my printer is still collecting dust and the only testing environment I have is a VM that is pretending to run klipper :laughing: If you can hint me towards the setup I can evaluate the complexity and consider adding (or excluding?) it.

Regarding symlinks I went the easy route by just copying the directory recursively, so it just catches everything in that directory, including symlinks. The easy way of ignoring symlinks would be to use rsync instead of cp, but this would mean I'd have to install another dependency, which I try to avoid for the most part. So to exclude those files I'd have to iterate over all files in a directory to evaluate each file before copying it. This isn't too complex, but would add some processing overhead to the backup procedure.

I started working on a v3 with multi-host support that eliminates the necessity for multiple repos, so you can store backups from multiple printers in just one repo, but development of that has slowed down significantly due to stress at work and my personal projects getting out of hand again. I'll add your suggestions to my notes and see what I can do.