World Backup Day

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 7-Zip since it’s for free, open source and it supports a command line interface.

Download bundle (7za.exe, backup.cmd)
SHA-256 checksum file*SHA256

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/switchdescriptioncurrent valueremark
aAddn/a
-mx0Set Compression Method0 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.
-tzipType of archivezipI’ve chosen zip because Windows has build in zip support. If you choose 7z you need an additional archive tool installed.
-spf2Use fully qualified file pathsUse full paths without drive letterif you want the drive letter included then use -spf instead
-rRecurse subdirectoriestrue
-i@%temp%\includes.txtInclude filenamesgenerated temporary fileadd all folders and extensions you want to be included in the backup
-x@%temp%\excludes.txtExclude filenamesgenerated temporary fileadd 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. OneDrive Download or Google Drive.

Leave a Comment

you're currently offline