Zip with password
7za a -p /tmp/photos_2015-11-11_181303.7z photos/*
Create a split
7za a -v500m -tzip mail 2.pst -----> create a split of 2.pst
7za t mail.zip.001 -----> test the split
update: 7z u archive.zip *.doc
extract: 7z x archive.zip
compression: -mx0 copy, -mx1 fasttest, -mx3 fast, -mx5 normal, -mx7 maximum -mx9 ultra, -mmt enable/disable multithreading, -ms=on enab
type switch: -t7z, -tgzip, -tzip, -tbzip2, -ttar, -tiso, -tudf
volume switch: -v to split the zip file
eg: 7z a -tzip archive.zip *.jpg -mx0
7za a pw.7z *.txt -pSECRET -----> created password protected file
7za.exe a archive.7z Z*.* -ssc ----> on windows enable case sensitive
Z*.*: select only files whose first letter is a capital Z
7z x mail.zip -aoa
7z: use the 7-zip executable
x: use the extract command
mail.zip: extract files from this archive
-aoa: overwrite all existing files. risky!
Switch: -aoa
Overwrite all destination files.
Switch: -aos
Skip over existing files without overwriting.
Use this for files where the earliest version is most important.
Switch: -aou
Avoid name collisions.
New files extracted will have a number appending to their names.
(You will have to deal with them later.)
Switch: -aot
Rename existing files.
This will not rename the new files, just the old ones already there.
-----------------------------
You can easily do an incremental backup via changing the direction in time. i.e. you always keep the latest backup as a full copy and keep differential files into the past.
# create the difference step into the past
7z u {base archive.7z} {folder to archive} -mx=9 -u- -up1q1r3x1y1z0w1!{decrement.7z}
# update the Archive to the latest files
7z u {base archive.7z} {folder to archive} -mx=9 -up0q0x2
The base Archive always contains the latest version and via applying the "decrements" step by step you can recreate older Versions. With a little bit scripting you can apply the right numbering to the decremental files.
-----------------------------
Exclude .svn from 7zip backup
To exclude all .svn and .git
Linux
7z a Documents.7z Documents/ -xr\!?svn -xr\!Documents/Books -xr\!Documents/hydrawordlist -xr\!Documents/vimwiki* -xr\!?git
Windows
7z a -r -t7z -y -xr!?svn\* test_data.7z test_data
-----------------------------
Delete source (-sdel) after compression
7z a -sdel archive.aes.7z archive.aes