Giter Site home page Giter Site logo

anarcat / bup-cron Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 4.0 140 KB

mirror of the bup-cron repository, may be out of date while i figure out github mirror things

Home Page: https://gitlab.com/anarcat/bup-cron

License: GNU Affero General Public License v3.0

Python 93.02% Shell 6.98%

bup-cron's People

Contributors

alfred-nsh avatar anarcat avatar blueyed avatar oxc avatar pfrouleau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bup-cron's Issues

Support for --exclude-rx-from

I am using a custom wrapper around bup currently and have a fairly huge --exclude-rx-from file already.

It seems like --exclude-rx itself is supported, but not documented.

Could this be supported with bup-cron?

Allow to configure whole branch name (--name / new option)

Currently you can specify the name, which is used as base of the branch name:

branch = '%s-%s' % (args.name, snapshot.src_path.replace('/', '_'))

Reading the help/code the name option makes a different impression, as if it would allow you to specify the whole name:

    # using the hostname as branch name
    group.add_argument('-n', '--name', default=socket.gethostname(),
                       help="""name of the backup passed to bup,
                               defaults to hostname (%(default)s)""")

What do you think about keeping the current default, but use the name as-is when passed by --name (without the substituted path appended)?
(of course, this would be backwards-incompatible)

looking for co-maintainers

i am not really contributing much to bup-cron anymore. while i still use it, i am effectively phasing it out in favor of borg when i can. i still have offsites running bup, so that stays for now, but most of my work is going towards borg when i have time.

so i'm looking for co-maintainers for bup-cron. it would be interesting to pass the buck to someone else here that would make regular releases and the usual. i'd like to keep some sort of power in the project, but i'd be happy to give access to others here. maybe we could create an github org or try (again) to merge this back into bup itself.

i know that @blueyed has submitted great pull requests here, so he's the first person i'm thinking of delegating this to (are you interested? :), is there anyone else?

IndexError in summary, if save is skipped

If saving is skipped, there's will be an error in summary, because self.sizes only contains a single entry:

calling command `bup index --exclude-rx-from=/etc/backup-exclude-bup.txt --one-file-system /home/user`
read Linux attr: [Errno 13] Permission denied: '/home/user/.local/share/vim/undo/%home%www-data%...'
Indexing: 148877, done (2818 paths/s).
WARNING: 1 errors encountered.
command failed
skipping save because index failed!
removing pidfile /mnt/backup/localhost.bup-cron/.bup-cron.pid
  File "/usr/local/bin/bup-cron", line 1084, in main
    success = process(args)
  File "/usr/local/bin/bup-cron", line 1052, in process
    logging.info(args.stats.summary())
  File "/usr/local/bin/bup-cron", line 968, in summary
    self.format_bytes(self.sizes[-2]),
None
aborted with unhandled exception IndexError: list index out of range

Use --repair with "bup fsck"?

I've noticed that bup-cron might fail:

calling command `bup fsck --verbose --par2-ok`
generating par2(1) recovery blocks
calling command `bup fsck --verbose --generate`
pack-XXX1 exists
…
pack-XXX2 exists
pack-XXX3 failed
pack-XXX4 exists
…
pack-XXX5 exists
…
pack-XXX6 generated
…
command failed
could not generate par2 parity blocks

Do you think passing in --repair in general to bup fsck makes sense?

bup-cron: cannot save stats note

I tried using the --stats option but looks like I just got an error stating "cannot save stats note".

What could cause that? Could it have something to do with the fact that bup-cron was not running as root?

Do not auto-create bup's dir

I am using a remote server with an encrypted volume for backup, which has to be opened/mounted.

The repository is /mnt/foo/encrypted/backup/bup-cron/, but /mnt/foo/encrypted does not exist, until it gets mounted.

bup-cron automatically created the directory, but should abort instead - just like bup used to do.

[nfr] Add an --include option

I'm using bup and want to switch to bup-cron for obvious reasons. I don't backup firefox because it seems like unecessary churn from history & state-saving (firefox crash recovery), plus we have Firefox Sync. But I do back up my 400Kb of bookmarks. I can't see how to do this in bup-cron, while I can with bup:

bup index "$HOME_DIR" --exclude "$HOME_DIR"/.mozilla
bup index "$HOME_DIR"/.mozilla/firefox/*/bookmarkbackups

I think bup-cron should have --include. Possibly bup-index could implement it, and bup-cron just pass it through :). I don't want to pass multiple paths with bup-cron -p, because then firefox is in a different backup to my other dotfiles.

(Am also slightly disturbed by the semantics illustrated in the example config file. Why are there multiple overlapping paths? Because implementing --snapshot effectively requires --xdev. But this means --snapshot affects what's being backed up. Strawman hack: implement --xdev if it's not already, and require it to be explicitly passed for --snapshot. Or snapshot recursively. Hmm, I wonder if other Windows backup programs handle mountpoints correctly with VSS :)).

Exclude list does not match when using snapshot feature

When using bup-cron's snapshot feature (-s LVM), bup index gets called like this (via bup-cron -s LVM /):

bup index --exclude-rx-from=/etc/backup-exclude-bup.txt --one-file-system /media/bup/vg0-rootlv

The exclude list however has paths relative to / tailored to / and therefore don't match the mounted location (/media/bup/vg0-rootlv).

Syslog program name is not obvious

Looks like the syslog program name is stored as "init.py" instead of something like "bup-cron":

Nov 30 22:30:10 sodium __init__.py[11097]: generating par2(1) recovery blocks

I don't know if that can be changed easily but it would be an improvement

More verbose stats / after-hook

It would be nice to have more detailed stats in the notes, e.g. similar to git log --dirstat=lines,cumulative,3.

Since preferences differ here, and this takes some time to generate, it would be nice to have a hook here, which would export the necessary information for an external tool / command.

This hook might not be linked to the "notes" process, but could be a generic one, allowing the user to add additional notes like suggested above (by using git notes append).

pyflakes errors

The first and third is easy, but I don't know if/how remote_cmd should get/be used:

./bup_cron/__init__.py:50: 'tempfile' imported but unused
./bup_cron/__init__.py:905: local variable 'remote_cmd' is assigned to but never used
./bup_cron/__init__.py:1005: local variable 'rep_info' is assigned to but never used

bup-cron: cannot save stats note on remote backups

Looks like bup-cron can't save stats when using option:
-r REMOTE, --remote REMOTE
a SSH address to save the backup remotely (example:
[email protected]:repos/repo.bup)

Currently this results in errors to stderr. I'm not sure if this should be supported or not?

In case it's not easy to get it working I would simply say something like "stats is not supported on remote backups" to stdout instead.

Do not skip saving for all "errors", e.g. "Permission denied"

bup save should not get skipped (always) when there are errors in bup index, because these might be irrelevant and should not prevent the whole backup from being saved, e.g.: read Linux attr: [Errno 13] Permission denied might happen when you've saved some file using sudo in $HOME (and you backup without using sudo).

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.