fcorbelli / zpaqfranz

Deduplicating archiver with encryption and paranoid-level tests. Swiss army knife for the serious backup and disaster recovery manager. Ransomware neutralizer. Win/Linux/Unix
MIT License
258 stars 22 forks source link

Create archives with volumes #75

Open KamikazeePL opened 11 months ago

KamikazeePL commented 11 months ago

Is it possible to create archive with multi-part volumes? Something like in 7-zip command 7z a a.7z *.txt -v100M

Quote from 7-zip help

-v (Create Volumes) switch Specifies volume sizes.

Syntax -v{Size}[b | k | m | g]

{Size}[b | k | m | g] Specifies volume size in Bytes, Kilobytes (1 Kilobyte = 1024 bytes), Megabytes (1 Megabyte = 1024 Kilobytes) or Gigabytes (1 >Gigabyte = 1024 Megabytes). if you specify only {Size}, 7-zip will treat it as bytes. It's possible to specify several -v switches.

NOTE: Please don't use volumes (and don't copy volumes) before finishing archiving. 7-Zip can change any volume (including first volume) at the end of archiving operation.

Examples 7z a a.7z *.txt -v10k -v15k -v2m

creates multivolume a.7z archive. First volume will be 10 KB, second will be 15 KB, and all others will be 2 MB.

fcorbelli commented 11 months ago

Yes, you can
In fact it was the very first change I suggested for zpaq, which was later integrated

The easiest is by multivolume, using how many "?" you want (in this example 4)

zpaqfranz a "z:\a_????.zpaq" c:\data\

You can see some examples with

zpaqfranz -he (name of the command)

In this case

zpaqfranz -he a

a means... add

with

zpaqfranz h h

the commands

fcorbelli commented 11 months ago

The 2nd way is using the backup command.

zpaqfranz backup z:\mygooddata c:\whatever d:\you e:\want

The backup command will create

Read the wiki or

zpaqfranz -he backup
KamikazeePL commented 11 months ago

I want to limit to size of zpaq archive.

fcorbelli commented 11 months ago

You cannot 😄
I could theoretically do this, but it would really require a lot of work

KamikazeePL commented 11 months ago

You cannot 😄 I could theoretically do this, but it would really require a lot of work

my first question was about it. We lost in translation.

fcorbelli commented 11 months ago

Is it really that important to divide into pieces of a fixed size?
It would indeed require quite complex development I'd rather spend more time on new features, like backups over TCP

fcorbelli commented 11 months ago

close for now

maximbry commented 7 months ago

You can limit the size of the archive using split. I think it would be nice to have this in the program, but in the meantime it's reasonable to handle it with external utilities.

fcorbelli commented 7 months ago

zpaqfranz does create "chunked" archives of fixed size (now) from 59.1

https://sourceforge.net/projects/zpaqfranz/files/59.1/

-chunk

After (quite a lot) of digging here the fixed-chunk version, a long overdue improvement Of course there are a lot of complexity to be taken in account (aka: nothing is easy with zpaq)

zpaq does not allow to create archives of a fixed size: this implies that, generally, the first file is gigantic, and subsequent ones much smaller. This prevented splitting on optical media (e.g., Blue Ray), and this is bad (incidentally that's "where" I'm going to use it). The zpaq's operating logic doesn't really provide multiple output files, but now (maybe) it does 😄

Operation, which is still not fully integrated (for example, it is not supported in the backup command), is easy to activate. It is like a normal multipart archive, but with a switch that indicates the maximum size of the pieces Running with encrypted archives has been difficult, and it is still not 101% tested

zpaqfranz a z:\ronko_?? whatever-you-like -chunk 1G
zpaqfranz a z:\ronko_?? who-knows -chunk 500m

The -chunk gets straight number (2000000), K,M,G (100M), KB,MB,GB (500MB) The chunks are not guaranteed to be 100% exact, typically should be multiple of 64KB

59.2 is underway (minor bug fixed, interaction with Windows GUI (PAKKA) 1

fcorbelli commented 7 months ago

https://github.com/fcorbelli/zpaqfranz/releases/tag/59.1

Basically, the size can be indicated in bytes, in multiples of 1000 (K, M, G) or in multiples of 1024 (KB, MB, GB)

15000000 10M 3GB 100KB

In version 59.1 there are not many controls, so it is good not to indicate size too small (* depends on 100 different factors). With the default settings I would not go below 100KB, just in case

I decided to implement to allow a split for Blue-Ray burning.

Note: the last piece will be LESS than the data set. The next version will NOT alter that file, but will create a new one.

TRANSLATION

if your archive become (first version, just an example)

part_01.zpaq 10000000
part_02.zpaq 10000000
part_03.zpaq 300

Running a second version will make something like

part_01.zpaq 10000000
part_02.zpaq 10000000
part_03.zpaq 300
part_04.zpaq 10000000
part_05.zpaq 10000000
part_06.zpaq 10000000
(...)
part_10.zpaq 55555

It is possible to convert a chunked file to a normal file, with the m (merge) command.

It is NOT possible, as with normal multipart files, to perform operations such as dump (command to see the internal structure) on individual chunks (the explanation is obvious: chunks no longer begin at versions)

sheckandar commented 1 month ago

Hello again.

I was testing -chunk switch today and ran into an issue.

sudo ./zpaqfranz a "/volume1/backups/NetBackup-??" "/volume1/snapshots/NetBackup/DC1.hbk" -to "/volume1/NetBackup" -chunk 10G -verbose -nosynology

The size of the directory was 4G, but I set the chunk size to 10 G for testing. zpaqfranz exited with an error.

zpaqfranz v60.4c-JIT-L(2024-07-13)
franz:-to                   <</volume1/NetBackup>>
franz:-chunk                       10.000.000.000
Filling -not for -nosynology
franz:-nosynology -verbose
Integrity check type: XXHASH64B+CRC-32
Creating /volume1/backups/NetBackup-01.zpaq at offset 0 + 0
Add 2024-07-17 20:21:11       850      4.338.431.557 (   4.04 GB) 4T (28 dirs): -m14
MAX_FRAGMENT 520.192 (507.94 KB)
878 +added, 0 -removed.
free(): double free detected in tcache 2 <--- error
Aborted

Exit code 134

If I set the chunk size below the total directory size, zpaqfranz work fine.

fcorbelli commented 1 month ago

60_5a.zip Please try the attached pre-release

sheckandar commented 1 month ago

It works now.

Much appreciated.