A tapu-backups host is meant to store backups of b2 hosts.
Designed as the foundational script, ./install.sh
automates the setup process for essential Ubuntu server services.
You'll find a breakdown of the tasks it performs below.
This script must be executed with root privileges.
- Checks that script run on correct directory and checks required args
- Creates .env file from .env.example and add/update BACKUPS_DISK* with command given args
- Does base server configurations and installs base services that are needed (vnstat, php-cli)
- Mounts and configures backup disk
- Installs cron and configure it, it'll start
./cron.php
every minute - Installs vsftpd server
- Installs API service that will listen for requests on port :8000
./install.sh --backup_disk /dev/sdb --backup_disk_mount /mnt/backups
Notes:
- You must execute the installation script with root privileges.
- The backup_disk arguments are needed to mount and configure the disk that will be used to store the backups.
The ./cron.php is executed evey minute
, it executes a series of jobs. It calls a controller depending on its configured crontab.
Jobs:
- release-expired-tokens controller is called every 5 minutes, it'll release token that are considered expired based on env variable TOKEN_VALIDITY.