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

sending delta differences on each run #329

Open cvillabrille opened 4 years ago

cvillabrille commented 4 years ago

Hi,

This is a question/improvement.

After being using for while btrbk I am happy with the balance between complexity of configuration and results (thanks for taking your time to develop it). However, there is something that is getting me crazy when I run the backups (or maybe my peanut brain is not able to understand).

I have defined the following btrbk.conf file with the shared keys between this host and the NAS:

snapshot_preserve_min   1d
snapshot_preserve       5d

target_preserve_min     no
target_preserve         10d 10w *m

archive_preserve_min    latest
archive_preserve        12m 10y

volume /mnt/btr_data
    snapshot_create  always
    target send-receive      ssh://10.0.2.150/dataready/Backup/
    subvolume  @
    subvolume  @home

Also a cron job on daily basis.

However, if I manually run the backup (after the daily cron) it does not transfer anything to remote, and it is only creating a local snapshot.

Is there a way of sending the delta differences after each run instead of only one time per day? (i.e: deleting the remote backup and create a new one).

I have to manually delete in local and remote all the backups/snapshots belonging to that day, and then run it again in order to have the remote storage updated.

Thanks in advance.

tempusfugit991 commented 4 years ago

hi i had this problem too:

the problem is in your config:

target_preserve 10d 10w *m

10d -> move a daily backup to the target and delete it after 10 days if you are running btrbk daily so there is no matching backup for the the day and a new one is transfered.

if you run it again (on a day) no new transfer would be done because of this .. solution: change the line to (for example)

target_preserve 24h 10d 10w *m

than you can transfer one backup per hour (but not more often) to the target and after 24h they are gone again ..

digint commented 4 years ago

Is there a way of sending the delta differences after each run instead of only one time per day? (i.e: deleting the remote backup and create a new one).

Try using target_preserve_min latest, this makes sure that your latest snapshot will also be transferred at every btrbk call. If you dont want them to be deleted (well, superseded by the next backup) the at the next call, set something like target_preserve_min 5d, this will keep all "manual" backups for 5 days.

cvillabrille commented 4 years ago

Thanks to both.

I have been testing the option in the last days and that's exactly what I was looking for.

Both options (24h and target_preserve_min) made the trick. Now everything is being transferred on each backup.