Hi Guys,
We've put together an unofficial script that should assist many users in getting their backup processes more or less automated. this script s been written in a way that users can take the parts that they need (sections marked off in the code), and incorporate them into their backup processes, or they can use the whole script as it is.
Please note that this script is not to replace your usual backup process.
When copying the script, please save it in a text file named RangerMSPAutoBackup.cmd, located on a different drive than the RangerMSP system (in any folder you wish). This is so that the backups don't get created on the drive that hosts RangerMSP, and the separation between the system & your backups is preserved.
Once you have the script saved, please download zip.exe (obtainable from google), and save the file in the same folder as the script.
The last step is to run the backup script, while adding the path to your RangerMSP folder as a command line parameter (No Backslash at the end of the path).
I.E. D:\>RangerMSPAutoBackup.cmd C:\RangerMSP
Here's the script:
@echo off
REM ================================================== =====================
REM
REM
REM Disclaimer:
REM This script has been created as a functional sample, in order to help to automate
REM your backup process. The script has been divided into sections so that you can easily
REM re-engineer the script to better automate your current backup method. This script
REM is not meant to replace your current backup method in any way, RangerMSP Business
REM Solutions Ltd or any of its employees do not take any responsibility for the data
REM stored in any backup and we highly suggest to keep all backup archives as separate
REM as possible from the main RangerMSP data, as well as implementing additional
REM safety & backup measures so that your data will not be in any risk of being lost.
REM
REM What this script does:
REM The script performs the following steps:
REM 1) Gather RangerMSP folder from Command-Line Parameter
REM 2) Create Database "Stop" file, for a safe backup (Disconnects all users from the system)
REM 3) Pause for 5 minutes. (Should be enough for all connections to be termiated)
REM 4) Compress RangerMSP data into a Zip archive (Archive is created in the same folder as the script
REM is run from)
REM 5) Delete Database Stop file
REM
REM Important Note: This backup script does not backup any of your Documents files, including ones
REM “attached” to RangerMSP;
REM please remember to backup your documents files in a separate archive.
REM
REM Once the Database stop file has been deleted, the database is reactivated, and your users will
REM be able to connect to the system again.
REM
REM
REM Parameters:
REM %1: Local path to RangerMSP CRM. When running the Backup script, the script needs you to input
REM the RangerMSP Folder Path in the command line right after the script name. Path must not end with
REM a BackSlash \
REM
REM
REM General Usage Example:
REM :\>RangerMSPAutoBackup.cmd C:\RangerMSP
REM
REM
REM Dependencies:
REM This script needs to be saved in a separate drive from the RangerMSP System files.
REM Please copy Zip.exe in the same folder with this script.
REM Zip.exe (Free Compression Tool) is easily obtainable from many places on the internet. We
REM suggest finding it in Google.
REM
REM ================================================== ================
if ###%1###==###### goto NoParam
goto ParamsFound
:NoParam
echo.
echo Missing path. Enter the local path to the RangerMSP CRM root directory.
echo Example: RangerMSPAutoBackup.cmd C:\RangerMSP
echo ================================================== ================
Echo Zip.exe (Free Compression Tool) is easily obtainable from many places
echo on the internet. We suggest finding it in Google.
goto End
:ParamsFound
REM = Close Datamase Connections======================================
if exist "%1\DbSys\RangerMSPStop.ini" del "%1\DbSys\RangerMSPStop.ini"
echo [TERMINATE] > "%1\DbSys\RangerMSPStop.ini"
echo TimeBeforeAutoTerminate=1 >> "%1\DbSys\RangerMSPStop.ini"
echo Stopping database connections...
echo Waiting 5 Minutes...
REM=============================================== ====================
REM = This section pauses the script for 5 minutes.===================
echo Time remaining until Backup - 5:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 4:30
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 4:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 3:30
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 3:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 2:30
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 2:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 1:30
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 1:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 0:30
Ping -n 30 127.0.0.1 >NUL
echo Backing up your data momentarily.
Ping -n 5 127.0.0.1 >NUL
REM=============================================== ====================
REM = Backup Command=========================================== =======
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)
zip -u RangerMSP_Backup_%mydate%_%mytime% %1\db\*.* %1\dbsys\*.* %1\filters\*.* -x RangerMSPstop
REM=============================================== ====================
REM = Reactivate Database========================================== ===
if exist "%1\DbSys\RangerMSPStop.ini" del "%1\DbSys\RangerMSPStop.ini"
echo Database reactivated...
REM=============================================== ====================
:End
We've put together an unofficial script that should assist many users in getting their backup processes more or less automated. this script s been written in a way that users can take the parts that they need (sections marked off in the code), and incorporate them into their backup processes, or they can use the whole script as it is.
Please note that this script is not to replace your usual backup process.
When copying the script, please save it in a text file named RangerMSPAutoBackup.cmd, located on a different drive than the RangerMSP system (in any folder you wish). This is so that the backups don't get created on the drive that hosts RangerMSP, and the separation between the system & your backups is preserved.
Once you have the script saved, please download zip.exe (obtainable from google), and save the file in the same folder as the script.
The last step is to run the backup script, while adding the path to your RangerMSP folder as a command line parameter (No Backslash at the end of the path).
I.E. D:\>RangerMSPAutoBackup.cmd C:\RangerMSP
Here's the script:
@echo off
REM ================================================== =====================
REM
REM
REM Disclaimer:
REM This script has been created as a functional sample, in order to help to automate
REM your backup process. The script has been divided into sections so that you can easily
REM re-engineer the script to better automate your current backup method. This script
REM is not meant to replace your current backup method in any way, RangerMSP Business
REM Solutions Ltd or any of its employees do not take any responsibility for the data
REM stored in any backup and we highly suggest to keep all backup archives as separate
REM as possible from the main RangerMSP data, as well as implementing additional
REM safety & backup measures so that your data will not be in any risk of being lost.
REM
REM What this script does:
REM The script performs the following steps:
REM 1) Gather RangerMSP folder from Command-Line Parameter
REM 2) Create Database "Stop" file, for a safe backup (Disconnects all users from the system)
REM 3) Pause for 5 minutes. (Should be enough for all connections to be termiated)
REM 4) Compress RangerMSP data into a Zip archive (Archive is created in the same folder as the script
REM is run from)
REM 5) Delete Database Stop file
REM
REM Important Note: This backup script does not backup any of your Documents files, including ones
REM “attached” to RangerMSP;
REM please remember to backup your documents files in a separate archive.
REM
REM Once the Database stop file has been deleted, the database is reactivated, and your users will
REM be able to connect to the system again.
REM
REM
REM Parameters:
REM %1: Local path to RangerMSP CRM. When running the Backup script, the script needs you to input
REM the RangerMSP Folder Path in the command line right after the script name. Path must not end with
REM a BackSlash \
REM
REM
REM General Usage Example:
REM :\>RangerMSPAutoBackup.cmd C:\RangerMSP
REM
REM
REM Dependencies:
REM This script needs to be saved in a separate drive from the RangerMSP System files.
REM Please copy Zip.exe in the same folder with this script.
REM Zip.exe (Free Compression Tool) is easily obtainable from many places on the internet. We
REM suggest finding it in Google.
REM
REM ================================================== ================
if ###%1###==###### goto NoParam
goto ParamsFound
:NoParam
echo.
echo Missing path. Enter the local path to the RangerMSP CRM root directory.
echo Example: RangerMSPAutoBackup.cmd C:\RangerMSP
echo ================================================== ================
Echo Zip.exe (Free Compression Tool) is easily obtainable from many places
echo on the internet. We suggest finding it in Google.
goto End
:ParamsFound
REM = Close Datamase Connections======================================
if exist "%1\DbSys\RangerMSPStop.ini" del "%1\DbSys\RangerMSPStop.ini"
echo [TERMINATE] > "%1\DbSys\RangerMSPStop.ini"
echo TimeBeforeAutoTerminate=1 >> "%1\DbSys\RangerMSPStop.ini"
echo Stopping database connections...
echo Waiting 5 Minutes...
REM=============================================== ====================
REM = This section pauses the script for 5 minutes.===================
echo Time remaining until Backup - 5:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 4:30
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 4:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 3:30
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 3:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 2:30
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 2:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 1:30
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 1:00
Ping -n 30 127.0.0.1 >NUL
echo Time remaining until Backup - 0:30
Ping -n 30 127.0.0.1 >NUL
echo Backing up your data momentarily.
Ping -n 5 127.0.0.1 >NUL
REM=============================================== ====================
REM = Backup Command=========================================== =======
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)
zip -u RangerMSP_Backup_%mydate%_%mytime% %1\db\*.* %1\dbsys\*.* %1\filters\*.* -x RangerMSPstop
REM=============================================== ====================
REM = Reactivate Database========================================== ===
if exist "%1\DbSys\RangerMSPStop.ini" del "%1\DbSys\RangerMSPStop.ini"
echo Database reactivated...
REM=============================================== ====================
:End
Comment