Node Backup and Update with check build
π οΈ Node Backup and Update with check_build
π Description
The `check_build` command is a DXSpider utility script that checks for new builds (updates) in the MOJO branch. If a new build is available, it can:
- Perform a full backup of the current node installation
- Retain previous backup archives
- Automatically update the node (Git hard reset + pull)
This tool does not aim to replace the standard `git` update method, but is especially useful for sysops who are cautious about updates potentially breaking their nodes. In case of failure, a full backup ensures the service can be restored quickly.
The script can be run manually from the DXSpider shell or scheduled via `crontab`.
βοΈ Features
- Verifies if a newer build is available on the remote repository.
- If backup is enabled:
- Creates a full backup using `rsync`
- Compresses it as `spider.YYYYMMDD.HHMMSS.tar.gz`
- Retains up to a configurable number of backup files
- Performs a full Git reset and update
- Optionally notifies via Telegram if configured
βΆοΈ Usage
From the DXSpider shell:
check_build <Y/N> <num_backups>
Where:
- `Y` = Enable backup before updating
- `N` = Update without backup
- `num_backups` = Number of backups to retain (default: 10)
π Example crontab configuration
Run the command Monday to Friday at 04:00 with backup enabled, keeping 7 backups:
0 4 * * 1,2,3,4,5 run_cmd("check_build Y 7")
Update the script daily (thanks to G6NHU) with:
30 0 * * * spawn('cd /spider/local_cmd; wget -qN https://raw.githubusercontent.com/EA3CV/dxspider_info/main/check_build.pl -O /spider/local_cmd/check_build.pl') 32 0 * * * run_cmd('load/cmd')
πΎ Installation
Download the script from the official repository:
View on GitHub - check_build.pl
Save it as:
/spider/local_cmd/check_build.pl
π Restoring a backup
If something goes wrong during the update:
1. Locate the latest backup archive in `/home/sysop/spider.backup`
2. Decompress it:
cd /home/sysop tar -xzvf spider.backup/spider.YYYYMMDD.HHMMSS.tar.gz
3. Replace the current `/spider` directory with the extracted backup
4. Restart DXSpider
βͺ Alternative: Using undo_newbuild.pl
If installed, the `undo_newbuild.pl` script allows you to quickly restore the most recent backup made by `check_build`.
Simply run:
set/undo_newbuild
This command will:
- Locate the latest backup archive in `/home/sysop/spider.backup`
- Decompress and restore it
- Restart the node automatically
π₯ Download
You can download the script from the repository:
View on GitHub - undo_newbuild.pl
Save it as:
/spider/local_cmd/undo_newbuild.pl
π¦ Dependencies
This script requires:
- Git
- rsync
To install `rsync` on Debian-based systems:
apt install rsync
π² Telegram integration (optional)
If the `telegram()` function is defined in `Local.pm` and Telegram bot variables (`$id`, `$token`) are set in `DXVars.pm`, the script will send notifications when:
- A backup starts
- A backup completes
For full setup instructions, see: Sending messages to the sysop via Telegram
π§ Notes
- Only supports the **MOJO branch** of DXSpider.
- Backup directory: `/home/sysop/spider.backup`
- Automatically excludes heavy folders: debug logs, spots, wwv, wcy, etc.
- Recommended for sysops who want to automate update and backup tasks with minimal risk.
π¨βπ» Author
- Kin EA3CV* β [1](mailto:ea3cv@cronux.net)