PhantomBotUpdate.sh is a bash script to keep PhantomBot instances deployed on linux servers up to date the easy way.
The script will
- check for available updates while keeping track of its own version
- update your bot
- migrate your configuration
- restart the bot
The standard configuration assumes you followed the Linux setup guide
I would suggest using an additional backup utility like Borg for long term backups.
To automatically run this script every day at 10am add
0 10 * * * /home/botuser/PhantomBotUpdate.sh
to your crontab (crontab -e)
There are 3 variables you can change:
-
The absolute path of the folder containing the update script
scriptPath='/home/botuser' -
Absolute path of your PhantomBot
botPath="$scriptPath/phantombot" -
Path to the upstream PhantomBot repository
repoPath="https://api.github.com/repos/PhantomBot/PhantomBot/releases/latest"
The following files/folders will be created/overwritten by this script:
- version.id File to keep track of the currently installed bot version; inside the defined PhantomBot folder
- bot-backup Backup folder for your previously running version; inside the script folder
- update.log Logfile to keep track of when the script ran, and if there was an update; inside the script folder