Automatic NT-Backup (System State Backup) with retention period and e-mail notification after complete.
A simple script for automatic System State backup where you can easily set backup retention period and it also send you an e-mail notification after completion. With this script you can also archive backup log and if you wish u can also set backup log retention period. It can also set backup files with date stamp.
For e.g., SysBackup_ComputerName_24-03-2009.bkf
You need two small utility,
For e.g., SysBackup_ComputerName_24-03-2009.bkf
You need two small utility,
- Blat.exe for sending mail, you can get details from here.
- Forfiles.exe for checking old files, you can get details from here.
Just download following zip file and extract its content to %windir%\ or%windir%\system32 folder.
Download:
Mail Notification
Following are the basic Backup Settings
::Backup Settings START
::Set Backup Path
::~~~~~~~~~~~~~~~~~~~~
set savepath=D:\TestBackup
::Set Backup Name
::~~~~~~~~~~~~~~~~~~~~
set backupname=SysBackup
::Set Backup Retention Period(in days)
::~~~~~~~~~~~~~~~~~~~~
set retention=3
::Set Log Archive Path(Only Folder Name)
::~~~~~~~~~~~~~~~~~~~~
set logarchivepath=BackupLog
::If ‘yes’ then backup log retention will enabled
::~~~~~~~~~~~~~~~~~~~~
set logretention=yes
::If avove settings is “yes” then set log Retention Period(in days)
::~~~~~~~~~~~~~~~~~~~~
set logretentionperiod=3
::———-x———
::E-Mail Settings (SMTP without authentication will work)
::———-x———
::If ‘yes’ a mail will be fired after backup
::~~~~~~~~~~~~~~~~~~~~
set _mailnotification=yes
::If ‘yes’ backup log will attached with mail
::~~~~~~~~~~~~~~~~~~~~
set attachment=no
::Type your e-mail address(for multiple e-mail ID, use ‘,’)
::~~~~~~~~~~~~~~~~~~~~
set email=urname@domain.com
:: Type from mail ID
::~~~~~~~~~~~~~~~~~~~~
set from=%computername%@TC-Auto-NTBackUP
::Set SMTP Server IP Address
::~~~~~~~~~~~~~~~~~~~~
set mserver=10.0.0.1
::Backup Settings END
::Set Backup Path
::~~~~~~~~~~~~~~~~~~~~
set savepath=D:\TestBackup
::Set Backup Name
::~~~~~~~~~~~~~~~~~~~~
set backupname=SysBackup
::Set Backup Retention Period(in days)
::~~~~~~~~~~~~~~~~~~~~
set retention=3
::Set Log Archive Path(Only Folder Name)
::~~~~~~~~~~~~~~~~~~~~
set logarchivepath=BackupLog
::If ‘yes’ then backup log retention will enabled
::~~~~~~~~~~~~~~~~~~~~
set logretention=yes
::If avove settings is “yes” then set log Retention Period(in days)
::~~~~~~~~~~~~~~~~~~~~
set logretentionperiod=3
::———-x———
::E-Mail Settings (SMTP without authentication will work)
::———-x———
::If ‘yes’ a mail will be fired after backup
::~~~~~~~~~~~~~~~~~~~~
set _mailnotification=yes
::If ‘yes’ backup log will attached with mail
::~~~~~~~~~~~~~~~~~~~~
set attachment=no
::Type your e-mail address(for multiple e-mail ID, use ‘,’)
::~~~~~~~~~~~~~~~~~~~~
set email=urname@domain.com
:: Type from mail ID
::~~~~~~~~~~~~~~~~~~~~
set from=%computername%@TC-Auto-NTBackUP
::Set SMTP Server IP Address
::~~~~~~~~~~~~~~~~~~~~
set mserver=10.0.0.1
::Backup Settings END
Batchfile NTBackup.bat
?Download NTBackup.bat
Now you have to create a schedule for daily backup.
Comments