digint / btrbk

Tool for creating snapshots and remote backups of btrfs subvolumes
https://digint.ch/btrbk/
GNU General Public License v3.0
1.69k stars 122 forks source link

Retention confusion about hourly propagation to daily #190

Open RomuloPBenedetti opened 7 years ago

RomuloPBenedetti commented 7 years ago

I was analyzing as one of my backup HDDs started to slow down and got somewhat confused. When I have this:

transaction_log            /var/log/btrbk.log                         

snapshot_dir               snapshot

preserve_day_of_week       sunday  
timestamp_format           long    
snapshot_preserve          24h 7d  

volume /mnt/FS_TREE/               
    subvolume                root  
        target send-receive  /mnt/HDDs/backups/snapshots/desktop      
            target_preserve  24h 15d 4w 12m                               
        target send-receive  /mnt/BigHDD/backups/snapshots/desktop    
            target_preserve  48h 30d 8w *m           

I'm noticing that hourly is propagating, for example, I have 24 hours backup of may 31, june 1, ...

Is there a way to store, last 48 hours, and so only one snapshot for each 15 days, 4 weeks, etc? It is getting somewhat insane, with 2533 snapshots in my backup HDD (for this backup, at total it is at 7k snapshots for all backups in this HDD).

digint commented 7 years ago

You did not specify snapshot_preserve_min and target_preserve_min, they both default to "all", making your snapshot_preserve and target_preserve options meaningless.

Try adding something like this to btrbk.conf:

snapshot_preserve_min 1d
target_preserve_min 1d

When running btrbk --print-schedule dryrun, you'll probably see most of your subvolumes being deleted, except the ones preserved by your snapshot_preserve and target_preserve configuration.

RomuloPBenedetti commented 7 years ago

Thanks, now I believe I really understand the difference between min and non-min polices.