I have create a GitHub repository with a number of bash scripts I use to manage PT Magic (PTM) on my VPS running Ubuntu 17.10. PT Magic (PTM), a free add-on for the Profit Trailer (PT) cryptocurrency trading bot.
The repository contains the following scripts:
- Deploy script (deploy-scripts.sh)
- PTM upgrade (ptm-upgrade.sh)
- PTM deploy presets (ptm-deploy-presets.sh)
What the scripts do is described briefly in the following sections. Please refer to the read me file in the repository for more information.
Developing user friendly scripts and writing readable and useful blogs costs time. I hope they are helpful to you and save you time and effort. If you would like to support me feel free leave a tip. Thanks in advance!
1. Deploy scripts (deploy-scripts.sh)
This script deploys the scripts to each PT Magic (PTM) instances, so each instance has the latest versions of the scripts. This means you can use git clone and pull to keep the scripts up to date. When a new version is available, just do a pull to sync and then call this script to deploy it to each PTM instances.
2. PTM upgrade (ptm-upgrade.sh)
Upgrades a PT Magic (PTM) instance to the latest version. It downloads the latest version of PTM from GitHub and installs it to a new directory with existing data and config files. This script must be run from inside the directory of the current PTM instance you wish to upgrade. If the latest version is already installed it will display a warning message and exit.
3. PTM deploy presets (ptm-deploy-presets.sh)
Presets have to be updated under both the PTM _presets directory and the PT trading directory. It is very inconvenient to do this manually. This script publishes presets to both directories in one go.
This script takes properties files placed in a specific directory and deploys them to both Profit Trailer (PT) and PT Magic (PTM). To do this safely it stops and restarts PT and PTM. This script must be run from the PTM instance directory. It expectsa subdirectory called ‘_deploy’ that contains the PAIRS.properties, DCA.properties and INDICATOR.properties you wish to deploy. Once the properties files have been copied it will restart PT and PTM. The existing properties files will be backed up to a unique subdirectory under the directory called ‘backup’ just in case a rollback is required.
These scripts make upgrading PT Magic and deploying presets a breeze. I hope you find them helpful.
If you liked this post, you might be interested in the following posts.
- Initial server setup Ubuntu 17.10
- Profit Trailer setup on Ubuntu 17.10
- PT Magic setup on Ubuntu 17.10