Archiving - ResgreenGroup/Botway-Documentation GitHub Wiki
Current Location: Home->Customizing BotWay->Archiving
BotWay Archiving
Botway can create copies of important files and store them in zip files. This process can be customized on the Achiving tab of the BotWay Settings dialog.
Archives Section
The top section of the Archiving dialog allows the creation and modifying of Archives. Each Archive has the following properties:
Enable
Enables/Disables the archive. If set to "false", the archiver will skip this archive.
Name
Controls the name of the folder that will hold a copy of the archived files.
Destination
The folder location where archived files will be created.
Count
Number of backups of the files to maintain. If more than "count" copies have been created, archiving will remove all copies older than the most recent "count" copies. For example, if set to 3, archiving will keep the most recent 3 archives of the files and delete any older copies.
Days
This controls how often, in days, the archive is to be run. For example, if set to 7, archiving will take place every 7 days from last archive. Note: A value of zero (0) will cause the archive to be run, once and only once, every time Botway is restarted.
Date
The date of the next archive run. This will be in the form(YYYYMMDD-HHMMSS). This date only needs to be set once and then is maintained by the archiver.
Mode
The Mode setting specifies whether the Archiver will MOVE the files to the Archive, and thus, delete them from the source folder, or COPY the files to the Archive while keeping the original files in the source folder. Using MOVE will cause each file to be archived and then cleared. Using COPY will cause each file to be archived but not cleared. In this way the source files and each archive can be controlled.
Sources Section
The lower section of the Archiving dialog allows the creation and editing of Archive Sources. Each Archive can have one or more Sources that contain files to be archived. Each Source has the following properties:
Source
Source will hold the path and pattern. These will point to and specify which files to archive.
Path
Specifies the folder location of the files to be archived. Note: using %dataPath% will set the path to the same as the "dataPath" entry set at the top of this properties file. Additionally using . or .. refers to the BotWay working folder or the parent of the BotWay working folder, respectively.
Pattern
Specifies the type of files to be archived by name and wildcards. The asterisk (*) and question mark (?) are used as wildcard characters, as they are in Windows and Linux. The asterisk matches any sequence of characters, whereas the question mark matches any single character. For example, a pattern of *.xml would archive all files having an xml extension.
Sample Archives Section
The above example has 3 distinct archives: "settings", "reports", "logs". Each archive is described below:
settings: This archive has two different sources. One is set to archive all files in the "data" folder that have an .xml extension. The other is set to archive all files in the BotWay folder that have a .properties extension. Each source will be archived each time BotWay runs. BotWay will maintain the most recent 10 copies of these files.
reports: set to archive all files in the "data" folder that have an .csv extension every 10 days. BotWay will maintain the most recent 3 copies of these files.
logs: set to archive just the monitor.log file in the "data" folder every day. BotWay will maintain the most recent 8 copies of this file.