Giter VIP home page Giter VIP logo

Comments (4)

digint avatar digint commented on May 23, 2024

If I understand it right, you need something like a "-r --resume-only" command line option, then you would be able to run btrbk by hand as soon as the USB stick is plugged in:

# btrbk -r /mnt/btr_pool/src_subvolume

while still having a daily cron job running btrbk.

I've been already thinking of implementing this, this should be pretty straight-forward.

For now, you can solve your problem by creating a separate config file for the manual run:

btrbk -c /etc/btrbk/btrbk.conf.usbdrive

/etc/btrbk/btrbk.conf.usbdrive:

volume /mnt/btr_pool
  subvolume src_subvolume
    snapshot_preserve_daily  all
    snapshot_create          no
    resume_missing           yes

    target_preserve_[...]

    target send-receive  /mnt/usb_stick/btrbk/

from btrbk.

digint avatar digint commented on May 23, 2024

I was somehow confused when writing the last comment here, as there already exists a "-r" (resume_only) feature, but the documentation was missing in the man-page.

Updated documentation in 7017e14

@chaosjug feel free to reopen this issue if this does not solve your problem

from btrbk.

chaosjug avatar chaosjug commented on May 23, 2024

This mostly solve my issue. There only one problem remaining:
When a backup is done without the USB drive, local snapshot are are not deleted even if they should. (Probably due to the error?)
When I manually start the backup with -r no snapshots are deleted:

NOTE: Preserved all backups (option -p or -r present)

So the snapshot accumulate until the USB drive is connected during a regular backup.
(@digint I don't have the rights to reopen the issue)

from btrbk.

digint avatar digint commented on May 23, 2024

If a target is not reachable, btrbk refuses to delete the snapshots. The reason for this is that one of the snapshots is needed as parent for incremental backup, and btrbk can not know which one this is if the target is not reachable.

With the -r option (resume-ONLY), no snapshots or backups are deleted.

For now, the only way to accomplish this is having two configs, one for cron and one for manual, e.g.:

/etc/btrbk/btrbk_cron.conf (only create snapshots):

volume /mnt/btr_pool
  subvolume src_subvolume
    snapshot_preserve_daily  all
    snapshot_create          no

/etc/btrbk/btrbk_manual.conf (perform backups and cleanup):

volume /mnt/btr_pool
  subvolume src_subvolume
    snapshot_preserve_[...]
    target_preserve_[...]

    snapshot_create          no
    resume_missing           yes

    target send-receive  /mnt/usb_stick/btrbk/

Maybe I'll implement something like "cleanup-only" option one day, but I think it's not as simple as it sounds...

from btrbk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.