Open steeveone opened 1 month ago
Yea but then people need to do more stuff vs this which works fine? Have you run into issues with things the way they are?
you are right, there is one more step involved. I did not have problems with the cp backup method, there is just the possibility of a corrupted db in case of concurrent access during a backup, so i tought it would be nice to have it properly done. said that it is up to you to modify the script or not.
easy way to implement both methods would be something like test -f $(which sqlite3) && sqlite3 $db_file ".backup $outfile || cp ~/printer_data/database/moonraker-sql.db" ~/printer_data/config/
`
hello, installing sqlite3 and changing 2 lines of code you could implement a safer way to backup the moonraker sqlite db.
Steps: apt-get install sqlite3
add
outfile=$config_folder/moonraker-sql.db
variable in variable declarations substitutecp ~/printer_data/database/moonraker-sql.db ~/printer_data/config/
withsqlite3 $db_file ".backup $outfile"
you could also check for sqlite3 command existence and decide if do a hot backup or a copy of the archive...