The goal here is to spend a little time on automation to save a lot of time and boring, repetitive effort over months and years. I've also more than once accidentally failed to add a password.
As many users are going to run this sort of thing on USB drives and cloud drives, I'm doing everything here with relative folders (e.g. .\output rather than z:\output)
Steps:
- Download and extract the 7za.exe file from 7-Zip Command Line Version site (http://7-zip.org/download.html) page and save it to the folder below the one you want to compress (in this example "FILES")
- Create two empty text files and save them as Compress.bat and Extract.bat
- Open both files and paste in the green text below:
Compress.bat fileCode: Select all
7za u -mx9 -r -mhe -pSECRETCODE Backup.7z ./FILES/*
- Explanation: This tells the computer you want to create (or update if already present) a Backup.7z file using the files in the local directory FILES and all it's subdirectories [-r] using the highest compression level [-mx9]. This will use encrypted headers (the file names are obscured) and the password "SECRETCODE" [-mhe -pSECRETCODE]
Code: Select all
7za.exe x Backup.7z -o.\OUTPUT -pSECRETCODE
- Explanation: This tells the computer you want to extract the Backup.7z file to the local folder "OUTPUT" with the same password from above
- Change the "SECRETCODE" to something else, ideally 15+ characters using a password generator.
- Launch either the Compress.bat or Extract.bat depending on your location (either beginning or destination computer)
- The 7-Zip Command Line Version includes a detailed included help file (as always I recommend viewing it in KchmViewer), but was a little unclear in places and the encryption section lacked a lot of examples that the rest of the document had. As a result, I borrowed a bit from two other links: http://www.dotnetperls.com/7-zip-examples and https://sourceforge.net/p/sevenzip/disc ... /bdc0378e/
- Large backups - If you have a ton of files or a very old computer, this setup can take a lot of time. You may want to change -mx9 to -mx5 (default) or -mx2 to lower the compression level.
- Security: This process will save the password locally to your computer. If that's an issue, you may want to run this from inside an encrypted volume like VeraCrypt or Truecrypt.
- Compressing text files - available PPMD compression can create some dramatic space savings (http://www.dotnetperls.com/7-zip-examples)
Feedback welcome.