The last World Backup Day was on March 31, 2021 but I think it’s always important to remind people of creating backups of their data they don’t want to loose. In this post I’ll show you how to create a backup of your NFO*, image and MediaInfo* file. You might use a Media Manager* like
or you’ve exported the stuff from your Zidoo Player, Kodi or any other source.
As tool to create the backup I’ve picked since it’s for free, open source and it supports a command line interface.
The windows command file template (backup.cmd)
@ECHO OFF
CHCP 65001> nul 2>&1
FOR /f "tokens=2 delims==" %%a IN ('wmic OS Get localdatetime /value') DO SET "dt=%%a"
SET "YY=%dt:~2,2%" & SET "YYYY=%dt:~0,4%" & SET "MM=%dt:~4,2%" & SET "DD=%dt:~6,2%"
SET "HH=%dt:~8,2%" & SET "Min=%dt:~10,2%" & SET "Sec=%dt:~12,2%"
SET "datestamp=%YYYY%%MM%%DD%" & SET "timestamp=%HH%%Min%%Sec%"
SET "fullstamp=%datestamp%%timestamp%"
:: includes.txt
(ECHO "P:\Stuff\*.nfo"&^
ECHO "P:\Stuff\*.jpg"&^
ECHO "P:\Stuff\*.png"&^
ECHO "P:\Stuff\*.xml"&^
ECHO "P:\Movie-Set Arts\*.nfo"&^
ECHO "P:\Movie-Set Arts\*.jpg"&^
ECHO "P:\Movie-Set Arts\*.png"&^
ECHO "P:\Movie-Set Arts\*.xml")>%TEMP%\includes.txt
:: excludes.txt
(ECHO "P:\Stuff\Folder1"&^
ECHO "P:\Stuff\Folder2"&^
ECHO "P:\Stuff\Folder3")>%TEMP%\excludes.txt
7za.exe a -mx9 -tzip -spf2 -r -i@%TEMP%\includes.txt -x@%TEMP%\excludes.txt "%datestamp%\backup_%fullstamp%"
DEL %TEMP%\includes.txt %TEMP%\excludes.txt
command/switch | description | current value | remark |
---|---|---|---|
a | Add | n/a | |
-mx0 | Set Compression Method | 0 means Copy mode (no compression) | I’ve chosen 0 because it’s fastest for zip and image types like jpg or png are not compressible anyway. If you choose 7z as Type of archive then set value to 5. |
-tzip | Type of archive | zip | I’ve chosen zip because Windows has build in zip support. If you choose 7z you need an additional archive tool installed. |
-spf2 | Use fully qualified file paths | Use full paths without drive letter | if you want the drive letter included then use -spf instead |
-r | Recurse subdirectories | true | |
-i@%temp%\includes.txt | Include filenames | generated temporary file | add all folders and extensions you want to be included in the backup |
-x@%temp%\excludes.txt | Exclude filenames | generated temporary file | add all folders you want to be excluded from the backup |
Extract downloaded backup.zip with Windows Explorer or the tool of your choice.
choose the destination folder
modify the windows command file template (backup.cmd)
add all folders and file types you want to be included
:: includes.txt
(ECHO "P:\Stuff\*.nfo"&^
ECHO "P:\Stuff\*.jpg"&^
ECHO "P:\Stuff\*.png"&^
ECHO "P:\Stuff\*.xml"&^
ECHO "P:\Movie-Set Arts\*.nfo"&^
ECHO "P:\Movie-Set Arts\*.jpg"&^
ECHO "P:\Movie-Set Arts\*.png"&^
ECHO "P:\Movie-Set Arts\*.xml")>%TEMP%\includes.txt
add all folders you want to be excluded
:: excludes.txt
(ECHO "P:\Stuff\Folder1"&^
ECHO "P:\Stuff\Folder2"&^
ECHO "P:\Stuff\Folder3")>%TEMP%\excludes.txt
output filename “%datestamp%\backup_%fullstamp%”
7za.exe a -mx9 -tzip -spf2 -r -i@%TEMP%\includes.txt -x@%TEMP%\excludes.txt "%datestamp%\backup_%fullstamp%"
save and execute backup.cmd
Open the created backup in Windows Explorer or the tool of your choice.
Store your backup at a safe place e.g. or .