How to make a backup in Windows XP ?
We have to use date in file naming in order to do a daily backup or to keep a consistency when doing backup.
Having said that, a simple explanation for %date% is necessary. Depending on date format it is better to name the file not using ‘/’ which is an inconvenient. So, to capture each element of the date, we have:
first part – %date:~0,2%
second part – %date:~3,2%
third part – %date:~6,4%
This is similar if you use substring function:
first part – substr(date, 0, 2)
second part – substr(date, 3, 2)
third part – substr(date, 6, 4)
The file (backup_stuff.bat) will look like this:
@set today_date=%date:~6,4%_%date:~3,2%_%date:~0,2%
ntbackup backup c:\Games /f "\\server\d$\bkp\backup_%today_date%.bkf"
ntbackup backup C:\music /f "\\server\d$\bkp\backup_%today_date%.bkf" /a
In order to backup more directories or to backup same directories every time the file is executed ‘/a‘ must be used. ‘/a‘ is used to append a directory to an existing backup.
For every directory in the backup process, the backup window will open.
I will update this post in order to have a silent backup and maybe with some log attach to it.
Sphere: Related Content