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

File search Request #117

Closed
copart opened this issue Sep 28, 2014 · 3 comments
Closed

File search Request #117

copart opened this issue Sep 28, 2014 · 3 comments

Comments

@copart
Copy link

copart commented Sep 28, 2014

I need a way to search for a file in all the archives and receive a list of the archives that have a copy (version) of that file with some file stats. Then I will know which archive to extract from. This is very usefull when you find out a file is corrupt, but not exactly sure when it became corrupted.

@joolswills
Copy link

You could do this via a small shell script?

REP="path/to/repo"; PAT="somefile"; for ARC in `attic list $REP | cut -d" " -f1`; do echo "$REP::$ARC"; attic list $REP::$ARC | grep "$PAT"; done

@copart
Copy link
Author

copart commented Sep 29, 2014

Thanks joolswills, this works for me. However, I did add to your script so that it shows what archive the file(s) are found. Including in case others want this.

#!/bin/bash
REP=$1
PAT=$2
for ARC in $(attic list $REP | cut -d" " -f1); do
    attic list $REP::$ARC | grep "\s$PAT" | awk -v arc="$ARC" "{ print arc,\$0 }"
done

@ThomasWaldmann
Copy link
Contributor

close?

@copart copart closed this as completed Dec 6, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants