I want to create an automated filelist-based backup script that is called like this:
7za a -t7z -mx=7 backup.1.7z @filelist
The filelist looks like this:
Now some of the files will be compressed into the archive's root folder, some get in their correct subfolders. It seems all files from C:\ and C:\Tools are in the root folder and only the C:\Tools\subdir\* files get into the subdir\ folder of the archive. So the first two directory levels will be merged into one.
What's going on there? Where can I set the base directory that all directory structure information will be stored relative to? I need the exact directory structure in the archive or things will be messed up.
I'm using 7zip 4.14 beta, because 3.13 doesn't even accept absolute pathnames in the filelist, which I also need for my application.
Hope anyone can help me.
The only way now. to change current folder to C:\ and use relative paths:
But my list file contains file both from C:\ and D:\ and how do I change the directory when I am running 7z.exe from VFP? There is no batch file to do that just a class I am using
Is there a chance future 7zip versions can do this with absolute pathnames? I like the 'patch' way to provide a number of directory levels to trim from the beginning as a cmdline parameter. This could work with relatively little work. I could try to create a patch to the 7zip sources when I find some time for it. :)
Later. Imho now it's not most important task.
Now I have another problem with it. I created a listfile with all relative paths to root and changed to the root dir before. But 7za copies all files multiple times into the archive. So the file c:\bin\abc\file can be found at these locations in the archive:
I consider this a bug, FYI. Hope it gets fixed in a future version.
Also it compresses all files in an indefinite order whereas the filelist contains a sorted list of files and directories.
1) don't use -r
2) 7-Zip resorts to increase compression ratio
OK, all back. I still used "\path\file" names instead of "path\file" names. This is bad... OK, fixed now and it works fine.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.