Synchronizing files using 7-Zip and the CLI

Using some info I found online, I figured out that -uq0 is the switch you probably want. Here's an example of an update script I just tested out based on this:

"C:\Program Files\7-Zip\7z.exe" u "C:\Users\dane\Documents\Docz.7z" -uq0 "C:\Users\dane\Documents\*" -r -x!*.7z -ssw -ms=off

I tested this out and it removed a file from the archive after I deleted the file.


Use the 'u' operator (update)

Slightly edited snippit from a backup job I run:

7z.exe u Documents.7z ".\Documents\*" -r -x!*.7z -x!*.pst -t7z -ssw -mx=3 -m3=LZMA2 -mmt=2