# Install Three routes, one result: a manager on `PATH`, a finder on `PATH`, the directories the tool writes to, and a configuration file only root can read. The tool is released under the MIT licence since 8.1.0. Requirements: **bash 5.1+**, GNU coreutils and findutils, WP-CLI, and `root` to switch into the owner of each site. `flock`, `timeout`, `nice`, `ionice`, `tar`, `gzip` and `curl` are used when present and degrade gracefully when they are not. The manager, the finder and the installer refuse an older bash with exit 3 and the version they found; hosts with bash 4.x (RHEL/Rocky/Alma 8) can stay on 8.1.1 but cannot run 9.0.0. ## Route 1: npm ```bash npm install -g bash-wp-cli-update ``` The package is a delivery channel: it ships the two scripts unchanged plus two shims (`wp-cli-update`, `wp-find`) that resolve their own real path and `exec` the script. The commands land in `$(npm prefix -g)/bin`. It does not install WP-CLI, it runs nothing at install time, and root is still needed at run time. ## Route 2: the installer from the release archive ```bash curl -LO https://github.com/paulmann/Bash_WP-CLI_Update/releases/latest/download/bash-wp-cli-update-9.0.1.tar.gz sudo ./install.sh --dry-run # show every step sudo ./install.sh --systemd # perform them, plus the nightly timer ``` `install.sh` is idempotent, has `--dry-run` and `--uninstall`, and installs the systemd unit and timer only when asked to. ## Route 3: by hand ```bash sudo apt-get install -y bash coreutils findutils gzip tar curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar sudo chmod 755 /usr/local/bin/wp sudo git clone https://github.com/paulmann/Bash_WP-CLI_Update.git /opt/wp-cli-update sudo chmod 755 /opt/wp-cli-update/Bash_WP-CLI_Update.sh /opt/wp-cli-update/Find_WP_Senior.sh sudo ln -sf /opt/wp-cli-update/Bash_WP-CLI_Update.sh /usr/local/bin/wp-cli-update sudo ln -sf /opt/wp-cli-update/Find_WP_Senior.sh /usr/local/bin/wp-find sudo install -d -m 755 /var/log/wp-cli-update /var/backups/wp-cli-update /var/lib/wp-cli-update sudo install -m 600 /opt/wp-cli-update/wp-cli-update.conf.example /etc/wp-cli-update.conf ``` ## Directories and permissions | Path | Mode | Holds | |---|---|---| | `/opt/wp-cli-update` | 755 | the checkout; both scripts are 755 | | `/usr/local/bin/wp-cli-update`, `wp-find` | symlinks | the two entry points | | `/var/log/wp-cli-update` | 755 | `manager.log`, `errors.log`, JSON reports | | `/var/backups/wp-cli-update` | created by the tool, 0700 | database dumps and tree archives | | `/var/lib/wp-cli-update` | 755 | the site list | | `/etc/wp-cli-update.conf` | 600 | configuration; it can carry a licence | The backup tree is root-only: a dump is a complete copy of a customer's data. Since 8.0.3 the export runs in a private temporary directory owned by the site owner and the dump is moved into place by root with `root:root 0640`. ## Configuration file placement * `/etc/wp-cli-update.conf` is read by every invocation; `