A scheduled backup solution for directories to S3-compatible storage with optional encryption and Discord notifications.
- 📦 S3-Compatible Storage - Backup to Amazon S3, MinIO, or any S3-compatible storage
- 🗜️ Archive Support - Compress directories as tar.gz archives before upload
- 🔐 GPG Encryption - Optional GPG encryption for secure backups
- ⏰ Scheduled Backups - Cron-based automatic backup scheduling
- 🧹 Automatic Retention - Configurable retention policy with automatic purging of old backups
- 🔔 Discord Notifications - Get notified on backup success, failure, or deletion errors
- ⚙️ Flexible Configuration - Configure via YAML file or environment variables
- 🔄 Version Checking - Automatic update availability notifications
Download the latest binary from the releases page.
git clone https://github.com/hibare/arclift.git
cd arclift
make init
go build -o arcliftAdd the Hibare repository and install Arclift:
# Download and import the GPG key
sudo wget -O /usr/share/keyrings/hibare-keyring.gpg https://apt.hibare.in/gpg.key
# Add the repository
echo "deb [signed-by=/usr/share/keyrings/hibare-keyring.gpg] https://apt.hibare.in/ * *" | sudo tee /etc/apt/sources.list.d/hibare.list
# Update package list and install
sudo apt update
sudo apt install arclift- name: Install Arclift
hosts: all
become: true
tasks:
- name: Download and import the Hibare repository
get_url:
url: https://apt.hibare.in/gpg.key
dest: /usr/share/keyrings/hibare-keyring.gpg
mode: "0644"
- name: Add Hibare repository source file to sources list
copy:
dest: /etc/apt/sources.list.d/hibare.list
content: "deb [signed-by=/usr/share/keyrings/hibare-keyring.gpg] https://apt.hibare.in/ * *"
- name: Update package list
apt:
update_cache: yes
- name: Install Arclift
apt:
name: arclift
state: present
- name: Copy configuration file to /etc/arclift
copy:
src: config/arclift-config.yaml
dest: /etc/arclift/config.yaml
- name: Restart Arclift service
service:
name: arclift
state: restarted
- name: Ensure Arclift service is enabled and started
systemd:
name: arclift
state: started
enabled: yes
register: arclift_service-
Initialize Configuration
arclift config init -c /path/to/config.yaml
This creates a default configuration file at the specified location.
-
Edit Configuration
Edit the generated config file with your S3 credentials and backup settings.
-
Run Backup Service
arclift -c /path/to/config.yaml
This starts the backup scheduler based on your cron configuration.
The configuration file uses YAML format and supports the following structure:
s3:
endpoint: "" # S3 endpoint URL (leave empty for AWS S3)
region: "us-east-1" # S3 region
access-key: "" # S3 access key
secret-key: "" # S3 secret key
bucket: "" # S3 bucket name
prefix: "" # Prefix for backup keys
backup:
dirs:
- /path/to/backup1
- /path/to/backup2
hostname: "my-host" # Hostname identifier for backups
retention-count: 30 # Number of backups to retain
date-time-layout: "20060102150405" # Datetime format for backup keys
cron: "0 0 * * *" # Backup schedule (daily at midnight)
archive-dirs: false # Archive directories as tar.gz
encryption:
enabled: false # Enable GPG encryption (requires archive-dirs: true)
gpg:
key-server: "keyserver.ubuntu.com"
key-id: "" # GPG key ID for encryption
notifiers:
enabled: false
discord:
enabled: false
webhook: "" # Discord webhook URL
logger:
level: "info" # Log level: debug, info, warn, error
mode: "json" # Log mode: json, textAll configuration options can be set via environment variables with the prefix ARCLIFT_:
export ARCLIFT_S3_ENDPOINT="http://localhost:9000"
export ARCLIFT_S3_ACCESS_KEY="admin"
export ARCLIFT_S3_SECRET_KEY="admin123"
export ARCLIFT_S3_BUCKET="my-bucket"
export ARCLIFT_BACKUP_CRON="0 0 * * *"Start the backup service with scheduled backups:
arclift -c /path/to/config.yamlPerform a one-time backup:
arclift backup -c /path/to/config.yamlOr using the subcommand:
arclift backup add -c /path/to/config.yamlList all available backups:
arclift backup list -c /path/to/config.yamlManually purge old backups based on retention policy:
arclift backup purge -c /path/to/config.yamlInitialize a new configuration file:
arclift config init -c /path/to/config.yamlArclift includes systemd service integration for running as a system service.
Located at scripts/arclift.service:
[Unit]
Description=Arclift Backup Service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/arclift
[Install]
WantedBy=multi-user.target- Post-Install (
scripts/postinstall.sh): Initializes config and enables the service - Pre-Remove (
scripts/preremove.sh): Stops and disables the service before removal
- Go 1.25.2 or higher
- Docker and Docker Compose (for development environment)
- golangci-lint (installed via
make install-golangci-lint) - pre-commit (for git hooks)
# Initialize development tools
make init
# Start MinIO for local testing
make dev
# Run tests
make test
# Clean up
make cleanThe development environment includes MinIO for local S3-compatible storage testing:
make devThis starts:
- MinIO server on port 9000 (API) and 9001 (console)
- Creates a test bucket named
test-bucket - Sets up test directories and files
Access MinIO console at http://localhost:9001 with credentials:
- Username:
admin - Password:
admin123
- Scheduler Initialization: On startup, Arclift initializes a cron scheduler based on the configured schedule
- Backup Process:
- For each configured directory:
- If
archive-dirsis enabled: Creates a tar.gz archive - If encryption is enabled: Encrypts the archive using GPG
- Uploads to S3 with a timestamped key
- Sends success/failure notifications
- If
- For each configured directory:
- Retention Management: After each backup, old backups exceeding the retention count are automatically purged
- Version Checking: Daily checks for new versions and notifies if updates are available
Backups are stored in S3 with the following key structure:
<prefix>/<hostname>/<timestamp>- prefix: Configured S3 prefix
- hostname: Machine hostname or configured identifier
- timestamp: Formatted datetime of backup creation