4 Replies Latest reply on Feb 29, 2012 12:13 AM by Sanjeeva Gurram



      I need one help i want to stop and start the Remedy service automatically and i have to copy the logs of the server from one location to other location and with in 2 mins and the Services has to  start automatically after 2 mins

      Thanks in Advance

      Sanjeeva Naidu

        • 1. Services
          Laurent Matheo

          Well it depends on your operating system first

          If it's under Windows you could use a batch file (.bat) with something like:

          net stop "service name"

          set log_date=%date:~6,4%%date:~3,2%%date:~0,2%

          md g:\backup\myfolder\%log_date%\

          copy d:\ars\arserver\db\*.log g:\backup\myfolder\%log_date%\

          del d:\ars\arserver\db\*.log

          net start "service name"


          I didn't test it, but that's the idea (stop service, create a folder, copy logs in folder, delete logs, start service).

          • 3. Services



            Are you stopping service just for copying logs? i guess you could copy it even if service is running.


            And if this is only one time requirement of restarting server for any purpose. i will suggest go for manual service control. any way scripts are also useful in this case.





            • 4. Re: Services



              Thanks for U r Help and can we achive the following steps by using u r commands


              1. Scheduled job to enable logs (e.g. filter log) and wait for 10 minutes
              2. After 10 minutes, disable the log(s) and cut and paste the log(s) at some pre-defined place
              3. Enable the logs again after movement of the file
              4. Repeat the same process from  1 through 3 continuously


              Sanjeeva Naidu G