The AdapLink standard backup is developed in the form of rules project. A Model type processing group can be configured using the rule project and can be scheduled through the AdapLink MTYP scheduler. The backup project acquires an exclusive lock ADAPLINK_BACKUP and executes the backup therefore all other model type processes are recommended to acquire the lock ADAPLINK_BACKUP before executing.
The backup rule project contains few rule families which can be configured according to the specific backup requirement. There are other rule families which perform the backup operation based on the configured values in the following rules. Only an experienced AdapLink user can customize those rule families if required.
The standard backup rules configuration takes backup of important folders, files and MS-SQL databases. All these can be configured and customized through predefined families in the rule project. Following are the short descriptions about each of these families which can be configured by the user:
AQUIRING_LOCK
The last argument of the assignment can be configured for the proper time value (hour:minutes:seconds) until the backup process should wait to get the lock.:
=LOCK_ACQUIRE("ADAPLINK_BACKUP", "EXCLUSIVE", "EXCEPTION", "01:00:00")
Default value for wait is 1 hour.
DEFINE_ADAPLINK_INSTALL_PATH
The AdapLink installation path can be configured here. The default path is C:\AdapChain\.
T_ADAPLINK_INSTALL_PATH = C:/AdapChain
The backup destination folder with name yyyyMMdd_hhmmss (current time stamp) will be created under the folder T_ADAPLINK_INSTALL_PATH\backup\.
DEFINE_DISK_SPACE_CHECK_LEVEL
The available disk space is checked before creating the new backup files. This is controlled through the parameter T_DISK_SPACE_CHECK_LEVEL which defines the warning level in terms of Bytes. The process throws an exception if the disk space available crosses beyond the warning level.
The below line sets the disk space warning level as 30 GB.
T_DISK_SPACE_CHECK_LEVEL = 32212254720L
DEFINE_DIR_ENTIRE_BACKUP
The following example shows that the entire folders acconfig available at path C:\AdapChain\AdapLink 5.3.7 service\acconfig\ with all the files in it should be backed up as folder name acconfig under the backup destination. Similarly the folder scripts available at path C:\AdapChain\scripts with all the files/folder with the matching criteria (“I*.*”) should be backed up as folder name ac_scripts under the backup destination.:
T_ARRAY_DIR_ENTIRE_BACKUP = {"C:/AdapChain/AdapLink 5.3.7 service/acconfig", "C:/AdapChain/scripts"}
T_ARRAY_ENTIRE_BACKUP_NAMES = {"acconfig", "ac_scripts"}
T_ARRAY_ENTIRE_BACKUP_FILTER_CHARS = {"*", "I*.*"}
DEFINE_DIR_LATEST_FILE_BACKUP
The following example shows that the latest file with matching criteria (“file*.*”) in folder c:\dir_source1\ needs to be backed up as folder name dir1. Similarly the latest file with matching criteria (“file*.txt”) in folder c:\dir_source2\ needs to backed as folder name dir2.:
T_ARRAY_DIR_LATEST_FILE_BACKUP = ={"C:/dir_source1", "C:/dir_source2"}
T_ARRAY_LATEST_FILE_BACKUP_NAMES = ={"dir1", "dir2"}
T_ARRAY_LATEST_FILE_BACKUP_FILTER_CHARS = ={"file*.*", "file*.txt"}
DEFINE_SQL_SVR_DATABASES
All the MS-SQL databases can be configured as shown in the example below:
T_ARRAY_SQL_SVR_DATABASES = ={"adaplink", "aldh", "sapstaging"}
All these database backup files will be backed up under the folder AdapLink Install Path\backup\mssql\.
DEFINE_CLEANUP_PARAMETERS
The old backup files can be deleted before the new backup files are generated. This can be achieved through a rule family where a parameter defines for how many days backward the backup files should be preserved. This step makes sure that there is enough space available for the new backup files.
The below line sets the number of days for preserving the old backup files as 30 days.
T_NUMBER_OF_DAYS_BACKWARD = 30
AdapLink backup process can also backup the Smoothie models and configuration. Following are the Smoothie specific rule families which can be configured in the rule project to take backup of Smoothie resources.
DEFINE_SMOOTHIE_BACKUP
Following example defines the Smoothie model name test1 and test2 for backup. Also points to the Smoothie installation directory and model backup path.:
T_ARRAY_SMOOTHIE_MODEL_NAMES = ={"model_1", "model_2"}
T_SMOOTHIE_INSTALL_PATH = C:/SmoothieMambo5
T_SMOOTHIE_BACKUP_DIR = C:/SmoothieMambo5/backups
All the Smoothie model backup files will be backed up under the folder AdapLink Install Path/backup/smoothie_backup.
DEFINE_PGSQL_DATABASES
The following example shows that the PostgreSQL database configuration needs to be backed up. Other parameters are the connection information which are used to connect to the database.:
T_ARRAY_PGSQL_DATABASES = ={"configuration"}
PGSQL_DUMP_PATH = C:/SmoothieMambo5/data/bin/pg_dump.exe
PGSQL_HOST = localhost
PGSQL_PORT = 27095
PGSQL_USER = postgres
All these database backup files will be backed up under the folder AdapLink Install Path\backup\pgsql.
Download a sample rule project including the Smoothie mambo model backup functionality AL_STD_BACKUP.rbac.
Note
The backup rule project is capable enough to compress the backed up files using the 7zip utility. The compressing is performed by the rule family COMPRESS_AND_CLEAN, which calls the command file COMPRESS.bat available under the configuration folder C:\AdapChain\AdapLink X.Y.Z service\acconfig\ExecCommand\ to compress the backed up files.
The first argument in COMPRESS.bat file denotes the path of the 7zip executable file. The default path for it points to the path C:\AdapChain\AdapLink X.Y.Z service\util\7z\7z.exe, which is bundled with the AdapLink service.