Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: allow globs in source paths #10

Open
jefft opened this issue May 9, 2014 · 5 comments
Open

Feature request: allow globs in source paths #10

jefft opened this issue May 9, 2014 · 5 comments
Labels

Comments

@jefft
Copy link

jefft commented May 9, 2014

It would be nice if one could include globs in source paths:

  myscripts:
      sources:
        - /path/to/*.py
        - /path/to/*.sh

to get the equivalent of the shell expression:

tarsnap -cf myscripts /path/to/*.py /path/to/*.sh

While just using Python's glob.glob() would do the trick, perhaps just letting shell expansions operate would be more powerful and reduce surprises (often one tests raw tarsnap commands first before encoding them in tarsnapper).

@jefft jefft changed the title Feature request: allow // Feature request: allow globs in source paths May 9, 2014
jefft pushed a commit to jefft/tarsnapper that referenced this issue May 9, 2014
@jefft
Copy link
Author

jefft commented May 9, 2014

I've referenced a one-line change that lets the shell expand globs.

@jefft
Copy link
Author

jefft commented May 9, 2014

Currently if a source path/directory does not exist, tarsnapper emits an error. Eg this:

 myscripts:
      sources:
        - /path/to/*.py
        - /path/to/*.invalid

gives:

Not backing up 'myscripts', because not all given sources exist

The tip of my branch eliminates this code (which would not work with shell expansions) and relies on tarsnap error reporting, which gives more specific errors anyway:

Creating backup myscripts: myscripts.20140509-154859
tarsnap execution failed:
tarsnap: /path/to/*.invalid: Cannot stat: No such file or directory
                                       Total size  Compressed size
All archives                               5.1 GB           4.1 GB
  (unique data)                            2.2 GB           1.5 GB
This archive                               1.4 kB           1.3 kB
New data                                    439 B           1.0 kB
tarsnap: Error exit delayed from previous errors.

@miracle2k
Copy link
Owner

The reason the warning exists is because I had this particular use-case where some backup sources may legitimately not be available at backup time.

I don't think I care anymore, and probably no one else does either, so I do believe we could get rid of it.

@coaxial
Copy link
Contributor

coaxial commented Sep 18, 2017

Wondering if this was still considered? I would love globbing as well, I'd like to backup the rrd data from a Munin master, but I can't do /var/lib/munin/**/*.rrd and I don't want any of the other non-rrd files in there.

@miracle2k
Copy link
Owner

I'd merge a pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants