From e3a9be246dde6e92dabdddfe85604085914f4dd3 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 5 Nov 2015 14:12:08 +0100 Subject: [PATCH] Use a script to push logs through webdav --- packages/logs.xml | 7 ++----- softwares/push_logs.bat | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 softwares/push_logs.bat diff --git a/packages/logs.xml b/packages/logs.xml index 5dc4e40..5092616 100755 --- a/packages/logs.xml +++ b/packages/logs.xml @@ -2,14 +2,11 @@ - - - - + diff --git a/softwares/push_logs.bat b/softwares/push_logs.bat new file mode 100644 index 0000000..c43dafa --- /dev/null +++ b/softwares/push_logs.bat @@ -0,0 +1,23 @@ +@echo off + +CALL %~dp0\..\conf\sync_conf.bat + +SET DRIVE=unknown +FOR %%D IN (e f g h i j k l m n o p q r s t u v w x y z) do ( + cd %%D: + IF ERRORLEVEL 1 SET DRIVE=%%D + IF ERRORLEVEL 1 goto :drivefound +) +goto :EOF + +:drivefound +net use %DRIVE%: %LOGS% /USER:%USER% %PASS% 1>NUL 2>NUL + +IF %ERRORLEVEL% NEQ 0 goto :EOF + +IF NOT EXIST "%DRIVE%\logs" mkdir "%DRIVE%\logs" +IF NOT EXIST "%DRIVE%\databases" mkdir "%DRIVE%\databases" +copy /Y "%SYSTEMROOT%\system32\wpkg.xml" "%DRIVE%\databases\%COMPUTERNAME%.xml" +copy /Y "%TEMP%\wpkg-%COMPUTERNAME%.log" "%DRIVE%\logs\%COMPUTERNAME%.log" + +net use /D %DRIVE%