Backup Batch

    Backup Batch

    Hello,

    here is a little batch file, were you can historicized your data, etl persistence and your repository.
    Please don't hesitate to contact me, if you have some better ideas.

    Source Code

    1. rem #############################################################################################################
    2. rem # @Author: Djordja Markovic #
    3. rem # @Email: d.markovic@vector.at #
    4. rem # @Version 1.0 #
    5. rem # @Date: 20120820 #
    6. rem # @Purpose: Creates up to five backup versions (historicized) of the given data, etl_persistence #
    7. rem # and the repository folder. #
    8. rem #############################################################################################################
    9. rem # Hint: #
    10. rem # You must create the given folder, like DATA_BACKUP and in the end a '1'. For example, the data backup #
    11. rem # folder DB=data --> the folder must be named: data1. This conditions also are valid for the repository #
    12. rem # and derby folder. Additionally you must create a logfile folder. #
    13. rem #############################################################################################################
    14. set DATUM=%date%
    15. set YEAR=%date:~6,4%
    16. set MONTH=%date:~3,2%
    17. set DAY=%date:~0,2%
    18. set TIMESTAMP=%YEAR%%MONTH%%DAY%
    19. set LOG=C:\Backup\logfiles\%TIMESTAMP%_Backup.log
    20. set DATA=C:\Program Files (x86)\Jedox\Palo Suite\palo\data
    21. set DATA_REP=C:\Program Files (x86)\Jedox\Palo Suite\tomcat\webapps\etlserver\data\projects
    22. set DATA_DERBY=C:\Program Files (x86)\Jedox\Palo Suite\tomcat\webapps\etlserver\data\db\etl_persistence
    23. set DATA_BACKUP=C:\Backup
    24. set DB=data
    25. set REPOSITORY=repository
    26. set DERBY=derby
    27. echo Start %date% %time% > %LOG%
    28. echo Source: %DATA% >> %LOG%
    29. echo Destination: %DATA_BACKUP% >> %LOG%
    30. echo %time%: ### Beginning shutdown palo services: >> %LOG%
    31. net stop PaloSuiteHttpdService >> %LOG% 2>&1
    32. net stop PaloSuiteHttpdService >> %LOG% 2>&1
    33. net stop PaloMDXInterpreter >> %LOG% 2>&1
    34. net stop PaloSuiteCoreService >> %LOG% 2>&1
    35. net stop PaloSuiteTomcatService >> %LOG% 2>&1
    36. net stop PaloSuiteMolapService >> %LOG% 2>&1
    37. echo %time%: ### Palo services are stopped. >> %LOG%
    38. echo %time%: ### Backup adn history created: >> %LOG%
    39. rmdir /Q /S "%DATA_BACKUP%\%DB%5" >> %LOG% 2>&1
    40. move /Y "%DATA_BACKUP%\%DB%4" "%DATA_BACKUP%\%DB%5" >> %LOG% 2>&1
    41. move /Y "%DATA_BACKUP%\%DB%3" "%DATA_BACKUP%\%DB%4" >> %LOG% 2>&1
    42. move /Y "%DATA_BACKUP%\%DB%2" "%DATA_BACKUP%\%DB%3" >> %LOG% 2>&1
    43. move /Y "%DATA_BACKUP%\%DB%1" "%DATA_BACKUP%\%DB%2" >> %LOG% 2>&1
    44. xcopy "%DATA%" "%DATA_BACKUP%\%DB%1\" /E /Y >> %LOG% 2>&1
    45. echo %time%: ### Successfully done. >> %LOG%
    46. echo %time%: ### Archives deleted: >> %LOG%
    47. del /Q /S "%DATA_BACKUP%\%DB%1\*.archived" >> %LOG% 2>&1
    48. echo %time%: ### Archives Successfully deleted. >> %LOG%
    49. echo %time%: ### Backup of repository is created: >> %LOG%
    50. rmdir /Q /S "%DATA_BACKUP%\%REPOSITORY%5" >> %LOG% 2>&1
    51. move /Y "%DATA_BACKUP%\%REPOSITORY%4" "%DATA_BACKUP%\%REPOSITORY%5" >> %LOG% 2>&1
    52. move /Y "%DATA_BACKUP%\%REPOSITORY%3" "%DATA_BACKUP%\%REPOSITORY%4" >> %LOG% 2>&1
    53. move /Y "%DATA_BACKUP%\%REPOSITORY%2" "%DATA_BACKUP%\%REPOSITORY%3" >> %LOG% 2>&1
    54. move /Y "%DATA_BACKUP%\%REPOSITORY%1" "%DATA_BACKUP%\%REPOSITORY%2" >> %LOG% 2>&1
    55. xcopy "%DATA_REP%" "%DATA_BACKUP%\%REPOSITORY%1\" /E /Y >> %LOG% 2>&1
    56. echo %time%: ### Successfully done. >> %LOG%
    57. echo %time%: ### Backup of derby created: >> %LOG%
    58. rmdir /Q /S "%DATA_BACKUP%\%DERBY%5" >> %LOG% 2>&1
    59. move /Y "%DATA_BACKUP%\%DERBY%4" "%DATA_BACKUP%\%DERBY%5" >> %LOG% 2>&1
    60. move /Y "%DATA_BACKUP%\%DERBY%3" "%DATA_BACKUP%\%DERBY%4" >> %LOG% 2>&1
    61. move /Y "%DATA_BACKUP%\%DERBY%2" "%DATA_BACKUP%\%DERBY%3" >> %LOG% 2>&1
    62. move /Y "%DATA_BACKUP%\%DERBY%1" "%DATA_BACKUP%\%DERBY%2" >> %LOG% 2>&1
    63. xcopy "%DATA_DERBY%" "%DATA_BACKUP%\%DERBY%1\" /E /Y >> %LOG% 2>&1
    64. echo %time%: ### Successfully done. >> %LOG%
    65. echo %time%: ### Palo services are starting: >> %LOG%
    66. net start PaloSuiteMolapService >> %LOG% 2>&1
    67. net start PaloSuiteTomcatService >> %LOG% 2>&1
    68. net start PaloSuiteHttpdService >> %LOG% 2>&1
    69. net start PaloSuiteCoreService >> %LOG% 2>&1
    70. net start PaloMDXInterpreter >> %LOG% 2>&1
    71. echo %time%: ### Palo services successfully started. >> %LOG%
    72. echo End %date% %time% >> %LOG%


    Best regards.
    Files
    Djordja Markovic

    Interessant things:
    Internal derby:
    jedox.com/community/palo-forum…ad&postID=14338#post14338
    Calculate your cube size:
    jedox.com/community/palo-forum…ad&postID=14406#post14406