Given the following:
7z u d:\folder\advtest1.7z -air!d:\folder\advtest2.7z -mx9 -ms=off d:\adv -u- -up0q0r2x0y2z0w0!d:\outputtest.7z
advtest1.7z and advtest2.7z both have the same files, except advtest2.7z has one additional file called abc.doc. The folder adv has the same files as advtest2.7z and one additional file called 123.doc.
What I expected to happen as I understand it:
p state: (no wildcards/not applicable)
q state: (no files in base archives that are not on disk/not applicable)
r state: (2) writes 123.doc to outputtest.7z
x state: (no newer files in base archives/not applicable)
y state: (no older files in base archives/not applicable)
z state: (0) prevents all files in base archives from being written to outputtest.7z (because files in base archives are all on disk)
w state: (no files with same times and different size/not applicable)
Summary: The only file I expect to be written to outputtest.7z is 123.doc
What really happened: all files in adv folder were written to outputtest.7z
Is there a way to do what I intended?
1) Summary: The only file I expect to be written to outputtest.7z is 123.doc
7-Zip compares d:\folder\advtest1.7z with d:\adv
so it must write abc.doc and 123.doc in your case
Create example directory with small number of files.
And show file names in advtest1.7z
7z l advtest1.7z
7-zip uses only one input archive for u command.
So it doesn't look advtest2.7z
Why do you need 2 input archives?
Yes, if only advtest1.7z is used, I agree that abc.doc and 123.doc should write, but why didn't they? Instead, all files did.
I do not understand your 2nd statement.
To answer your 3rd statement, I need to create a new archive with files that are on disk, but not in a set of old archives. Is that possible?
I want to see files in advtest1.7z before your command:
7z l advtest1.7z > list.txt
Date Time Attr Size Compressed Name
2012-12-14 22:42:25 D.... 0 0 Advtest1
2010-05-02 18:23:28 ....A 1760 26333 Advtest1\April10.txt
2011-07-15 17:01:08 ....A 16983 Advtest1\Aug10.txt
2011-01-06 18:35:06 ....A 5064 Advtest1\Dec10.txt
2010-03-03 01:40:45 ....A 3469 Advtest1\feb10.txt
2010-02-04 01:57:34 ....A 3639 Advtest1\Jan10.txt
2010-08-02 23:38:36 ....A 12398 Advtest1\July10.txt
2010-07-07 23:41:55 ....A 14105 Advtest1\June10.txt
2010-04-01 19:13:45 ....A 2894 Advtest1\march10.txt
2010-06-03 15:24:14 ....A 10493 Advtest1\May10.txt
2010-12-03 09:32:59 ....A 446 Advtest1\Nov10.txt
2010-11-06 10:37:14 ....A 2536 Advtest1\Oct10.txt
2010-10-02 16:36:56 ....A 8819 Advtest1\Sept10.txt
82606 26333 12 files, 1 folders
1) You have Advtest1 folder in archive
2) You add Adv folder to new archive.
The names are different.
Maybe you must use D:\Adv* command. If you have D:\Adv\Advtest1* files.
The names of my archives are rarely, if ever, the same as the name of any folder because I have many folders in one archive. I am using one folder in the example here for simplicity.
Okay, I changed it to:
7z u d:\folder\advtest1.7z -air!d:\folder\advtest2.7z -mx9 -ms=off d:\adv* -u- -up0q0r2x0y2z0w0!d:\outputtest.7z
...and got the same result.
1) don't use -air!d:\folder\advtest2.7z
It doesn't work.
2) if you use
and you have file
7-zip will use relative name
and if you have Advtest1\somefile file in archive,
the names are different.
Instead you must have adv\somefile in archive, or d:\Advtest1\somefile on disk. Then update operation will see same name.
I would say that the which files are added issue is because of the -ai, which you said doesn't work as Advtest1 is not the name of any folder, but the name of the archive.
Anyway, my original question was if there is a way to add to a new archive, files on disk that are not contained in a set of existing archives. I thought -ai was the way to do that and I asked about it, and you say it is not. Is there a way? Thanks.
"Anyway, my original question was if there is a way to add to a new archive, files on disk that are not contained in a set of existing archives. I thought -ai was the way to do that and I asked about it, and you say it is not. Is there a way? Thanks."
Should I conclude, then, that it cannot be done? Thanks.
In case there is some misunderstanding of what I am trying to find out, I would like to restate here my original question, which was implied from my first post, as the first post was my attempt at a solution, which through the above, I found out will not work.
Here is what I am trying to find out here: a way to create and add to a new archive, files on disk that are not contained in a group of existing archives.
Is it possible? Thanks.