I have been using 7zip to backup files on my system and recently wanted to exclude unwanted file types from my backups.
File types such as Thumbs.db and .tmp files to be precise.
With the command line you’d use the “-x!” parameter. For example:
C:Program Files7-Zip7z.exe a -t7z F:Backup.7z F:MyFiles*.* -r -x!*.db -x!*.tmp
Here is a little breakdown of what the command switches are in the example above:
7z.exe [Path to 7z.exe]
a [Add files to archive]
-t7z [Type of archive, in this case 7z]
F:Backup.7z [Destination file]
F:MyFiles*.* [Source file(s)]
-r [Recurse into subfolders]
-x!*.db [eXclude *.db files/folders]
-x!*.tmp [eXclude *.tmp files/folders]
Here is another one for the road. I am doing what I have listed above but i am also encrypting, password protecting it and splitting the archive into smaller parts. I have been thinking about taking part of the split archive and placing it out in the cloud so that the data is unrecoverable until that file is added to the backup set; using it as a key file.
“c:Program Files7-Zip7z.exe” a -mx0 -mhe -pYOURPASSWORD -r -x!*.db -v2g “g:backup”%DATE:~-4%-%DATE:~4,2%-%DATE:~7,2%”%DATE:~-4%-%DATE:~4,2%-%DATE:~7,2%_backup.7z” “d:private”