PTC专门用于INTRALINK数据的备份的软件
發表於 : 2010-04-16 21:42:21
http://hi.baidu.com/afardesign/blog/ite ... 1aa2f.html
ilink-backup.bat
@ECHO OFF
SET ILINK_DRV=e:
SET ILINK_DIR=\ptc\dataserver
SET BACK_DRV=d:
SET BACK_DIR=\ptc_backup
%BACK_DRV%
CD %BACK_DIR%
IF EXIST TMP.TXT DEL TMP.TXT
DATE /T > TMP.TXT
FOR /F "TOKENS=1,2,3 DELIMS=/ " %%I IN (TMP.TXT) DO @SET TODAY=%%I
DEL TMP.TXT
time /T > TMP.TXT
FOR /F "TOKENS=1,2 DELIMS=: " %%I IN (TMP.TXT) DO @SET now_time=%%I%%J
del tmp.txt
MKDIR %TODAY%%NOW_TIME%
CD %BACK_DRV%\%BACK_DIR%
COPY KEYIN.TXT %BACK_DRV%\%BACK_DIR%\%TODAY%%NOW_TIME%
CD %TODAY%%NOW_TIME%
rem create dataserver dump file
REM %ILINK_DRV%
REM cd %ILINK_DRV%\%ILINK_DIR%\intralink\export
call %ILINK_DRV%\%ILINK_DIR%\intralink\export\ilink_export manager %BACK_DRV%\%BACK_DIR%\%TODAY%%NOW_TIME%\%today%-%now_time%.dmp
rem create object list file
%BACK_DRV%
cd %BACK_DRV%\%BACK_DIR%\%TODAY%%NOW_TIME%
call %ILINK_DRV%\%ILINK_DIR%\intralink\objects\ilink_object_report < keyin.txt
REN ILINK_ALL_OBJECT_REPORT.LOG %today%-%now_time%-OBJ_LIST.TXT
rem DEL ILINK*
DEL KEYIN.TXT
rem shutdown intralink server
rem call %ILINK_DRV%\%ILINK_DIR%\bin\dbshut_ilink.bat
rem call %ILINK_DRV%\%ILINK_DIR%\..\fileserver\bin\fserv_shutdown.bat
rem Start NTBACKUP
rem NTBACKUP BACKUP d:\ptc\dataserver d:\ptc\fv /v /t normal
copy e:\ptc\fv %BACK_DRV%\%BACK_DIR%\%TODAY%%NOW_TIME%
REM Start intralink server
rem call %ILINK_DRV%\%ILINK_DIR%\..\fileserver\bin\fserv_startup.bat
rem call %ILINK_DRV%\%ILINK_DIR%\bin\dbstart_ilink.bat
rem NTBACKUP eject tape
rem NTBACKUP eject
%BACK_DRV%
CD %BACK_DIR%
ilink-backup.bat
@ECHO OFF
SET ILINK_DRV=e:
SET ILINK_DIR=\ptc\dataserver
SET BACK_DRV=d:
SET BACK_DIR=\ptc_backup
%BACK_DRV%
CD %BACK_DIR%
IF EXIST TMP.TXT DEL TMP.TXT
DATE /T > TMP.TXT
FOR /F "TOKENS=1,2,3 DELIMS=/ " %%I IN (TMP.TXT) DO @SET TODAY=%%I
DEL TMP.TXT
time /T > TMP.TXT
FOR /F "TOKENS=1,2 DELIMS=: " %%I IN (TMP.TXT) DO @SET now_time=%%I%%J
del tmp.txt
MKDIR %TODAY%%NOW_TIME%
CD %BACK_DRV%\%BACK_DIR%
COPY KEYIN.TXT %BACK_DRV%\%BACK_DIR%\%TODAY%%NOW_TIME%
CD %TODAY%%NOW_TIME%
rem create dataserver dump file
REM %ILINK_DRV%
REM cd %ILINK_DRV%\%ILINK_DIR%\intralink\export
call %ILINK_DRV%\%ILINK_DIR%\intralink\export\ilink_export manager %BACK_DRV%\%BACK_DIR%\%TODAY%%NOW_TIME%\%today%-%now_time%.dmp
rem create object list file
%BACK_DRV%
cd %BACK_DRV%\%BACK_DIR%\%TODAY%%NOW_TIME%
call %ILINK_DRV%\%ILINK_DIR%\intralink\objects\ilink_object_report < keyin.txt
REN ILINK_ALL_OBJECT_REPORT.LOG %today%-%now_time%-OBJ_LIST.TXT
rem DEL ILINK*
DEL KEYIN.TXT
rem shutdown intralink server
rem call %ILINK_DRV%\%ILINK_DIR%\bin\dbshut_ilink.bat
rem call %ILINK_DRV%\%ILINK_DIR%\..\fileserver\bin\fserv_shutdown.bat
rem Start NTBACKUP
rem NTBACKUP BACKUP d:\ptc\dataserver d:\ptc\fv /v /t normal
copy e:\ptc\fv %BACK_DRV%\%BACK_DIR%\%TODAY%%NOW_TIME%
REM Start intralink server
rem call %ILINK_DRV%\%ILINK_DIR%\..\fileserver\bin\fserv_startup.bat
rem call %ILINK_DRV%\%ILINK_DIR%\bin\dbstart_ilink.bat
rem NTBACKUP eject tape
rem NTBACKUP eject
%BACK_DRV%
CD %BACK_DIR%