-
Notifications
You must be signed in to change notification settings - Fork 25
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
how to extract a single file? #63
Comments
I figured out that free space detection seems broken on macOS, so if add
But, when I try
...it fails. So, new question: is it possible to extract all versions of a single file at the same time as overriding destination with |
Yes, you can, with ranges zpaqfranz h x |
And you can quickly select files with only -only *.png |
Hmm, ok well sorry to have bothered you. I can't figure it out, just doesn't work on my system. But I will keep trying. |
Relax |
In your case, all version of a file, something like
You can use whatever you want for range, better NOT using - (I'll fix the help) Example
The free space test definitely needs to be improved; it doesn't actually work if the folder doesn't exist. |
Sorry for little off topic: I sometimes use bandizip (https://en.bandisoft.com/bandizip/) to extract single files. It support zpaq files. It is Windows only, but maybe it will work with wine or something. |
Well... I use my own GUI extractor :) |
Please check the attached-prelease (not tested on Mac, only on BSD)
Of course with g++ (/clang) installed. On newer Mac at first invocation everything should be "automagically" download |
Thank you for trying to help @fcorbelli I did compile the custom build using the exact command you posted, and it runs successfully 🙏 However, it is outputting errors when I try to extract.
Also, for extraction purposes, if we have a tree structure where the file basename alone is not enough to guarantee uniqueness, e.g.
I guess the correct way to extract only |
(...)
running the .sh BTW what exactly you want to do, with -only and -all?
You are right. Of course the "right" way is the full path
I do not know fzf You can try the attached pre-release (quick and dirty, not refined of course) with the
On Windows there is the text-based GUI, but it takes too much effort on *nix |
Asked for help on fzf |
Thank you for the continued effort! In my situation, my "goal" would be to extract the last 3 versions, for example. I don't think the I compiled latest test version from 58_7i.zip, tests seem to pass
But, with my old, existing .zpaq archive, these new builds can't operate:
The old |
The "-" is not good (because confuse the parser)
What kind of CPU do you have? Maybe M1 or M2? You can see in the header Please try
|
Ah, yes I am working on M1 and M2 cpus, sorry. I rebuilt using The initial test of |
Work in progress... :) |
Awesome! I have not played with fzf on Windows, but there are Windows binaries in case you haven't found them, could be helpful in testing |
zpaqfranz (for Windows) already include a text-based "GUI" :) |
58_7j.zip Should
|
@fcorbelli this is great! well, I only have 2 comments:
It doesn't work, I have to use
Not sure if it's a bug... |
Bit too complex to do, I don't think I will be implement anytime soon.
Not a bug, at best a feature :) |
Ok fair enough, but why does |
You are extracting a file to a folder
A file to a file
The file(s) inside a folder to a folder
A file to a folder, creating subfolders as needed
|
|
I understand the examples you give above, but I think some things are not working right on the macOS version, or at least not working as they do on Windows. For me, with the following syntax, zpaqfranz is ignoring the $ zpaqfranz x my-test-backup.zpaq '/Users/luke/some/path/file.png' -to /private/tmp/ -all Instead of creating a
It gets created in my current directory (
Also, in your examples, you have e.g. This variant with fails: $ zpaqfranz x my-test-backup.zpaq -only '/Users/luke/some/path/file.png' -to /private/tmp -all succeeds: $ zpaqfranz x my-test-backup.zpaq -only '*/Users/luke/some/path/file.png' -to /private/tmp -all -space Lastly, in fzf discussion you show a sample output (maybe theoretical) where files are listed along with their version#s:
Is this output possible? Current |
fzf should show versions with -all On the rest Why? Because dr.Mahoney choose this way https://mattmahoney.net/dc/zpaqdoc.html Almost everything is maintained for backward compatibility as a drop-in replacement (not 100% in fact, the output is way different, I do not like zpaq's output at all) |
Ok, I have been playing around with the syntax. I understand now that you don't want to change the syntax to stay as close to Dr. Mahoney's spec as possible. I will say that in all my years of working in the shell, this has to be one of the craziest syntax/arg parsers I've ever seen! I still don't understand why this command does not work:
But this one (with
Also, this version (without
I am using the exact syntax you gave as a "file to a file" in your example above. For now, I am at least able to extract a specific file @ a specific snapshot version, but there seem to be some things broken here. |
I indeed agree :)
This is a bug on the new "mac-friendly-get-the-free-space"?
Can you please attach some kind of your file to make some tests? Unfortunately, on *nix you don't know what a file is, or even a folder, or even "where" a file is (there are mounts) So figuring out if /tmp/foo.txt is a file, or a folder, is not trivial, not at all. The "old" zpaq does not have any kind of verification on written data. If space runs out (which happens frequently in planned backups) the .zpaq file will be silently "truncated," but without zpaq giving an error message [data of course non exctractable] As you can see this is a gigantic problem (for crontab executions) So zpaqfranz tries to do three things (which succeed well on Windows, not so well on *nix, but better then nothing) On Windows it is quite simple (ignoring symlinks that actually exist, but are rare), not so simple on network shares Short version: practically everywhere by putting a -space these tests are not done, just to allow starting even in the case of "confusion" Another note: to restore a single version the switch is -until. Range does a whole range of other things. Translation: if in version 9 you have 100 files, and in version 10 you have 3 files, with -until (I am simplifying, there are 1000 different cases, nothing is easy with zpaq) you will get a folder with 103 files With range you will get a folder with 3 files |
Let's take this one as a real-world example
We want to extract the second to last (the 24.064 bytes long) single file
Here it is
Restore single file WITHOUT space-check (-space) (no 21571 and 21584 in output)
If you want to get the X version (of this file) use -until X, NOT range X |
Now you want to know "where" to find the versions of a file We want to find (and get) different version of "something". Please note -only *something and -all
If you want the 2nd one you will do a x (blablabla) -until 153Of course, in "real world", I would prefer something "shorter"
Sidenote: running a range 153 extraction will take everything inside the version 153
In this example there are 139 files (/folders) inside version 153; 72 previous files/folders no more present, ~9.5MB Therefore range 153 is NOT just like -until 153, it is FROM 153 TO 153 |
Thank you @fcorbelli Indeed, this format works (example)
I am happy 🙏 ... confused, but happy... which is fine |
Actually, after a couple of years of digging, it starts to make sense :) PS should work without -space too. Maybe... who knows? :) :) |
A bit of explanation on the heuristic
is /tmp/restored/bar.md an existing folder? => yes, get free space, no => continue, split the path in "pieces", ad rebuild backward until the n-1 (take the "father" of /tmp/restored/bar.md, that should be /tmp/restored)If /tmp/restored is a path that does exists, then zpaqfranz will "automagically" get the free space on /tmp/restoredIf /tmp/restored does NOT exists, then zpaqfranz throws in the towel and "thinks" there is no spaceIn fact, it is true, a non existend path does not have free space I didn't make further attempts, otherwise sooner or later you get to "/," and there the space is (generally) always present Short version: if you are dealing with non-existent output paths, use -space to bypass any checks. |
I think I can close, at least for now, after explaination and examples |
I read (multiple times) all examples, docs, searched directly the code from the repo... Sorry I couldn't figure it out.
I also looked at #13 but even the example given is not working for me
I am using
zpaqfranz v58.6c-NOJIT-L(2023-07-19)
on macOS 13.4.1 - installed via HomebrewSimple example, I have a folder I want to back up:
I issue this command:
All fine so far... archive is created, and I can also update, seems to work fine
Now I want to restore just
file3.png
...I made many failed attempts...
list (ok)
extract - 1st try (fail)
extract - 2nd try (fail)
extract - 3rd try (fail)
extract - 4th try (fail)
extract - 5th try (fail)
How do I do it? 🤷
The text was updated successfully, but these errors were encountered: