jzohrab / lute

DEPRECATED: LUTE (Learning Using Texts) is a self-hosted web app for learning language through reading, based on Learning with Texts (LWT)
The Unlicense
118 stars 10 forks source link

Backup files with timestamp and rolling settings #25

Closed 99MengXin closed 1 year ago

99MengXin commented 1 year ago

Is your feature request related to a problem? Please describe.

In the V2 beta version, there is currently only one backup file available, and the manual files are also rolled by the automatic backup.

Describe the solution you'd like

It would be helpful to create backup files with timestamps and keep all manual backups because there are instances where people prefer manual backups. It would also be great if those backup files could be managed in Lute.

Additionally, we might consider keeping 2-3 auto backup files, and include one file from the end of the previous month.

Describe alternatives you've considered

Add timestamps feature and move backup files manually.

Additional context

2023-04-17_15 29 26

jzohrab commented 1 year ago

This is fixed in develop, thanks.

I wasn't sure about the concept for "manual", but hey, why not. "Manual" backups (where you click the link) are prefixed by "manual_" in the filename. Automatic ones aren't prefixed, and are governed by the "BACKUP_COUNT" .env file param (wiki also updated).

For example:

MacBook-Air-2:lute_dev jeff$ ls -1 zz_backup/
lute_backup_2023-04-19_204452.db.gz     # I only have 5 "automatic" backups
lute_backup_2023-04-19_204512.db.gz
lute_backup_2023-04-19_204519.db.gz
lute_backup_2023-04-19_204547.db.gz
lute_backup_2023-04-19_204604.db.gz
manual_lute_backup_2023-04-19_204132.db.gz     # I'll have as many of these as I decide to keep
manual_lute_backup_2023-04-19_204204.db.gz
manual_lute_backup_2023-04-19_204652.db.gz
userimages_backup    # There is only one folder of images, ever.  :-)