ttionya / vaultwarden-backup

Backup vaultwarden (formerly known as bitwarden_rs) SQLite3/PostgreSQL/MySQL/MariaDB database by rclone. (Docker)
MIT License
1.04k stars 119 forks source link

Replace existent backup file with new one #42

Closed quyleanh closed 2 years ago

quyleanh commented 2 years ago

When I do backup every 5 minutes, I notice that the backup file never updated as my config. It's seems that 7z tool cannot overwrite existent files. Could you update the backup script to delete the old one before compressing and uploading the new one?

Thank you.

ttionya commented 2 years ago

Hey @quyleanh ,

The backup tool re-creates the directory each time it is run via cron, and it is used to store the files that need to be uploaded to remote storage. So there will not be a situation where the 7z tool generates a zip archive that needs to overwrite the original files.

Maybe you mean that rclone does not overwrite existing files when uploading to remote storage? If so, I hope you will provide the type of remote storage used.

quyleanh commented 2 years ago

Thank you for your quick response. Currently I use onedrive as remote storage. I am not sure if rclone copy command replace the old backup or not.

quyleanh commented 2 years ago

My bad. It did uploaded the new one. I just check the modified time on detail panel. There is no problem with backup code.

Screenshot_20220109-142715_OneDrive

I will close this issue.

ttionya commented 2 years ago

I use OneDrive as remote storage too.

You can find historical versions of each file, so you can use days(%Y%m%d) as filenames without losing any versions of files that are backed up every day. This is useful.