cgcel / obsidian-local-backup

Automatically creates a local backup of the vault.
MIT License
33 stars 1 forks source link

[FEAT] Specify number of backups per day to retain #13

Closed decaf-dev closed 8 months ago

decaf-dev commented 8 months ago

Problem

Right now you can specify the number of days you want backups for, the frequency of backups, but you cannot specify how many backups per day to keep.

For example, if you backup every 30 minutes you will get

This will lead to dozens of backups for a period of 7 days.

Solution

Add an input to specify the number of backups per day to retain.

For example, if I had the value to 1 backup per day with a frequency of backup of 30 minutes

I would get

After 3 days I would have

cgcel commented 8 months ago

Yes it is a necessary feature, I will work on it.

cgcel commented 8 months ago

This feature is included in 0.0.9! Plz upgrade and setup in setting page.

decaf-dev commented 8 months ago

I waited until 12 am the next day to see what would happen. I have the Backup history length set to 7 and the Backups per day set to 1. The 1 backup per day is working. However, it looks like the previous day's back up is being deleted.

Current behavior:

I would expect backup 2 at 11:30 pm backup to be retained and backup 3 to be created.

cgcel commented 8 months ago

I waited until 12 am the next day to see what would happen. I have the Backup history length set to 7 and the Backups per day set to 1. The 1 backup per day is working. However, it looks like the previous day's back up is being deleted.

Current behavior:

  • backup 1 - 11:00 pm
  • backup 2 - 11:30 pm ---> delete backup 1 at 11:00 pm
  • backup 3 at 12:00am ----> delete backup 2 at 11:30 pm

I would expect backup 2 at 11:30 pm backup to be retained and backup 3 to be created.

Yes I met this issue after released, will fix it.

cgcel commented 8 months ago

I waited until 12 am the next day to see what would happen. I have the Backup history length set to 7 and the Backups per day set to 1. The 1 backup per day is working. However, it looks like the previous day's back up is being deleted.

Current behavior:

  • backup 1 - 11:00 pm
  • backup 2 - 11:30 pm ---> delete backup 1 at 11:00 pm
  • backup 3 at 12:00am ----> delete backup 2 at 11:30 pm

I would expect backup 2 at 11:30 pm backup to be retained and backup 3 to be created.

Fixed in 0.1.0. I renamed the settings options, pls reconfig the plugin after upgrading to 0.1.0 😄