I have to manage system after old administrator. I have a problem about backup batfile
because all workstation on network can backup but have only one can't backup,don't have any
file in folder that difference from another workstation. (i add batfile in scheduled task for
run everyday)
and I don't know why.I view code for get help ...please.
echo off
cls
::*********************************************************************************************
::*Erstellt von: Daniel Banfi am 08.11.2005 Version 1.04 *
::*Definition: *
::*Dieses Programm kopiert das Krones-Backup Verzeichnis der Workstations auf das Backupsystem*
::*********************************************************************************************
::*********************************************
::*Variable fr Verzeichnisse gesetzt *
::*Variable fr Sprungpunkt gesetzt *
::*Variable fuer Zeit gesetzt *
::*********************************************
set jahr=%date:~-4%
set monat=%date:~-7,2%
set tag=%date:~-10,2%
set sharename=Krones-Backup
set nummer=0
set backuplw=f:
:anfang
set /A nummer=%nummer%+1
goto %nummer%
::************************************************************************************
::* Hier werden die einzelnen Workstations mit Host Name und IP Addressen aufgezไhlt.*
::************************************************************************************
:1
set pc-name=WT01B19_SRV01
set ip-address=10.17.12.21
goto kopieren
:2
set pc-name=WT01B19ASRV01
set ip-address=10.17.12.22
goto kopieren
:3
set pc-name=SP01B15_SRV01
set ip-address=10.17.12.149
goto kopieren
:4
set pc-name=EN01B25_CLT01
set ip-address=10.17.13.21
goto kopieren
:5
set pc-name=EN01B25_CLT02
set ip-address=10.17.13.22
goto kopieren
:6
set pc-name=EN01B25_CLT03
set ip-address=10.17.13.23
goto kopieren
:7
set pc-name=EN01B25_CLT04
set ip-address=10.17.14.24
goto kopieren
:8
set pc-name=FI01B23ACLT01
set ip-address=10.17.13.149
goto kopieren
:9
set pc-name=BP02B10ASRV01
set ip-address=10.17.9.149
goto kopieren
:10
set pc-name=BP02B10ASRV02
set ip-address=10.17.9.150
goto kopieren
:11
set pc-name=FI03B10ASRV01
set ip-address=10.17.9.151
goto kopieren
:12
set pc-name=FI03B10ASRV02
set ip-address=10.17.9.152
goto kopieren
:13
set pc-name=BP02B10ACLT01
set ip-address=10.17.9.153
goto kopieren
:14
set pc-name=BH01B10BCLU01
set ip-address=10.17.14.38
goto kopieren
:15
goto ende
::*****************************************************************************************
::*Es wird das freigegebene Krones-Backup Verzeichnis der jeweiligen Workstation verbunden*
::*Ein Ordner mit dem Host Namen der Workstation wird auf dem Backupsystem erzeugt *
::*Das Krones-Backup Verzeichnis wird kopiert *
::*Das freigegebene Verzeichnis wird getrennt *
::*****************************************************************************************
:kopieren
echo Copy Backupdata from %pc-name% to %backuplw%\%pc-name%
echo.
echo.
if not exist %backuplw%\%pc-name% md %backuplw%\%pc-name%
xcopy /E /Y /M \\%ip-address%\%sharename% %backuplw%\%pc-name%
dir /o:-n %backuplw%\%pc-name% | findstr /m "REG_.*bkf" > %backuplw%\%pc-name%\oldREG.txt
FOR /F "tokens=4 skip=7" %%i in (%backuplw%\%pc-name%\oldREG.txt) do if %%i neq REG_%jahr%%monat%%tag%.bkf del %backuplw%\%pc-name%\%%i
del %backuplw%\%pc-name%\oldREG.txt
dir /o:-n %backuplw%\%pc-name% | findstr /m "FULL_.*bkf" > %backuplw%\%pc-name%\oldFULL.txt
FOR /F "tokens=4 skip=3" %%i in (%backuplw%\%pc-name%\oldFULL.txt) do if %%i neq FULL_%jahr%%monat%%tag%.bkf del %backuplw%\%pc-name%\%%i
del %backuplw%\%pc-name%\oldFULL.txt
dir /o:-n %backuplw%\%pc-name% | findstr /m "DIFF_.*bkf" > %backuplw%\%pc-name%\oldDIFF.txt
FOR /F "tokens=4 skip=8" %%i in (%backuplw%\%pc-name%\oldDIFF.txt) do if %%i neq DIFF_%jahr%%monat%%tag%.bkf del %backuplw%\%pc-name%\%%i
del %backuplw%\%pc-name%\oldDIFF.txt
cls
goto anfang
:ende
echo on
.... Number6, ip-address=10.17.13.23 can backup itself but can't backup to destination.