User Tools

Site Tools


brewer_scripts

Brewer Scripts

A description of the scripts that are being used for the Canadian Brewer Spectrometer network. The latest codes can be found on github. Contact Reno.sit@ec.gc.ca for access. All script has been tested on Linux Mint 19.x and Linux Ubuntu 20.04 LTS. Requirement:

  • Python 3

Operational

brewer_restart.py

This script was created to automatically restart the brewer's dosbox if it detects the dosbox not running. (This was developed because since the change to linux, dosbox has started randomly closing (seeing dosbox frozen is a lot less now). This script uses the argument/variable during launched to determine what which brewers to look for.

Example
python3 /home/brewer/schedule_task/brewer_restart.py 055 195
crontab
 45 * * * * python3 /home/brewer/schedule_task/brewer_restart.py 055 195

This script requires the brewer_restart.sh script. The location for the script must be set in line 13. Location of the log files can be set in line 14. Note: All brewer number must be in formatted as ### (008, 055 etc…)

brewer_restart.sh

Just a short shell script to run the dosbox command. Change the dosbox conf line here if required. This script accept 1 argument to specify which brewer to start up. It will only take the first argument, if multiple brewer needs to be restarted, run this on a loop.

Example
./brewer_start.sh 008

Note: All brewer number must be in formatted as ### (008, 055 etc…)

brewer_starter.py

Similar to brewer_restarter.py, however it is meant to used as a desktop icon to start a new brewer dosbox. It will kill any existing dosbox for that brewer prior to starting a new one.

Example
 python3 brewer_restarter.py 055
br055.desktop
[Desktop Entry]
Name=br#055
Exec=python3 /home/brewer/schedule_task/brewer_starter.py 055
Comment=Created by Reno Sit
Terminal=false
brewer_scripts.txt · Last modified: 2021/11/22 18:51 by reno