Script de backup para NTBackup.
Obs.: Usando o utilitário Blat Mail.
####
rem BACKUP EM FITA
rem definicao de variaveis blat
set remetente=
set destino=
set assunto=
set corpo=
set smtp=
set sem=%date:~-14,3%
set mes=%date:~-7,2%
set dia=%date:~-10,2%
set nome=
Echo Limpa logs do NTBACKUP >> D:\backup\Log_BkpFita\log_%sem%.txt
date /t >> D:\backup\Log_BkpFita\log_%sem%.txt
time /t >> D:\backup\Log_BkpFita\log_%sem%.txt
Echo. >> D:\backup\Log_BkpFita\log_%sem%.txt
dir "C:\Documents and Settings\Administrador\Config~1\Dados de aplicativos\Microsoft\Windows NT\NTBackup\data\" >> D:\backup\Log_BkpFita\log_%sem%.txt
del "C:\Documents and Settings\Administrador\Config~1\Dados de aplicativos\Microsoft\Windows NT\NTBackup\data\*.log" /F /Q
dir "C:\Documents and Settings\Administrador\Config~1\Dados de aplicativos\Microsoft\Windows NT\NTBackup\data\"
Echo Inicio da Rotina de BKP em Fita > D:\backup\Log_BkpFita\log_%sem%.txt
date /t >> D:\backup\Log_BkpFita\log_%sem%.txt
time /t >> D:\backup\Log_BkpFita\log_%sem%.txt
Echo. >> D:\backup\Log_BkpFita\log_%sem%.txt
rsm refresh /LF"Hewlett Packard DAT72 USB drive" >> D:\backup\Log_BkpFita\log_%sem%.txt
ntbackup backup "@D:\Backup\Backup_Fita.bks" /J "%nome%" /p "4mm DDS" /N "%nome%" /D %nome%" /R:no /RS:no /HC:on /V:no /L:f /M normal /UM
if /I %ERRORLEVEL% GTR 0 (blat -server %smtp% -f %remetente% -to %destino% -subject %assunto% -body %corpo%)
Echo Fim da cópia em Fita >> D:\backup\Log_BkpFita\log_%sem%.txt
date /t >> D:\backup\Log_BkpFita\log_%sem%.txt
time /t >> D:\backup\Log_BkpFita\log_%sem%.txt
Echo. >> D:\backup\Log_BkpFita\log_%sem%.txt
Echo Eject da Fita >> D:\backup\Log_BkpFita\log_%sem%.txt
rsm refresh /LF"Hewlett Packard DAT72 USB drive" >> D:\backup\Log_BkpFita\log_%sem%.txt
sleep 120
rsm eject /LF"Hewlett Packard DAT72 USB drive" /astart
Echo. >> D:\backup\Log_BkpFita\log_%sem%.txt
Echo Fim da Rotina de Backup em Fita >> D:\backup\Log_BkpFita\log_%sem%.txt
date /t >> D:\backup\Log_BkpFita\log_%sem%.txt
time /t >> D:\backup\Log_BkpFita\log_%sem%.txt
Echo. >> D:\backup\Log_BkpFita\log_%sem%.txt
Echo compacta logs antigos do NTBACKUP >> D:\backup\Log_BkpFita\log_%sem%.txt
date /t >> D:\backup\Log_BkpFita\log_%sem%.txt
time /t >> D:\backup\Log_BkpFita\log_%sem%.txt
Echo. >> D:\backup\Log_BkpFita\log_%sem%.txt
dir "C:\Documents and Settings\Administrador\Config~1\Dados de aplicativos\Microsoft\Windows NT\NTBackup\data\" >> D:\backup\Log_BkpFita\log_%sem%.txt
copy "C:\Documents and Settings\Administrador\Config~1\Dados de aplicativos\Microsoft\Windows NT\NTBackup\data\*.log" D:\Backup\Log_BkpFita\NTBackup\log_%dia%.txt
dir "C:\Documents and Settings\Administrador\Config~1\Dados de aplicativos\Microsoft\Windows NT\NTBackup\data\"
exit
quarta-feira, 5 de janeiro de 2011
Assinar:
Postagens (Atom)