As previously mentioned, I've started backing my important files up to Dropbox to make sure I have a copy of the things I can't replace, should the worst happen. To easily encrypt the file contents, I decided to put things into password-protected 7-Zip files before copying into my Dropbox folder.

The problem with putting everything into the same zip file, is that any change to a single file would cause Dropbox to upload the entire archive again. This would be quite a waste of bandwidth!

So, I came up with the following solution. If I create an encrypted 7-Zip file for each sub-directory within a given directory (eg. for each photo album within my photos directory), then only folders that contain changes will be uploaded/overwritten. Since I rarely make changes to photo albums, but frequently create new ones, this will ensure my new files are backed up without constant uploading of the old ones, while still sending any changes I do make to the existing albums. To script this, I'm using the command-line version of 7-Zip.

The following command will loop through each sub-directory in the provided directory, and call 7-Zip, telling it to compress the contents into a 7-Zip file (using the original directory name as the zip filename). Note: This is written for use in a .bat file. You may need to tweak it to use it directly on the command-line.

for /D %%d in ("D:\Pictures\*.*") do "J:\Downloads\Utilities\7-Zip\7za" a -mx0 -t7z -pSuperStrongPasswordHere12345 "J:\TempBackup\Photos\%%~nd.7z" "%%d\*"

You'll want to replace the bold parts with the directory you want to back up, the location of the command-line version of 7-Zip, the password you want to encrypt with and finally, the location to store the files in. I put them into a temp folder first, then copy them over into the Dropbox folder once completed.

It's worth noting that because the script loops through the sub-directories, it will not include any files in the root directory you specified. If you want to include them too, you'll need to add another command, eg:

"J:\Downloads\Utilities\7-Zip\7za" a -mx0 -t7z -pSuperStrongPasswordHere12345 "J:\TempBackup\Photos\_Files.7z" "D:\Pictures\*"

If you don't mind the script taking a little longer, you can change the "mx" argument to compress the files ("mx0" = "zero compression") and it'll take up less space on your Dropbox account. If you're going to encrypt things, make sure you store the encryption password somewhere offsite - so that if the need comes to rebuild a PC, you still have a copy of it!