fix(scripts): migrate to rclone from aws-cli and add cleanup actions
Some checks failed
Deployment CI/CD / validate (push) Has been cancelled
Deployment CI/CD / deploy (push) Has been cancelled

This commit is contained in:
2026-06-06 14:24:17 +03:30
parent 09952319e8
commit caf482e9f4
4 changed files with 177 additions and 79 deletions

View File

@@ -267,7 +267,7 @@ Install backup upload prerequisites:
```bash
sudo apt update
sudo apt install -y awscli openssl
sudo apt install -y rclone openssl
```
Configure encrypted S3-compatible backup uploads in `./.env`:
@@ -275,21 +275,23 @@ Configure encrypted S3-compatible backup uploads in `./.env`:
```bash
S3_BACKUP_BUCKET=qlockify-backups
S3_BACKUP_PREFIX=qlockify
S3_BACKUP_REGION=us-east-1
S3_BACKUP_ENDPOINT_URL=https://c284984.parspack.net
S3_BACKUP_ACCESS_KEY_ID=
S3_BACKUP_SECRET_ACCESS_KEY=
BACKUP_ENCRYPTION_PASSPHRASE=
BACKUP_LOCAL_KEEP_LATEST=1
BACKUP_LOCAL_KEEP_LATEST=3
BACKUP_REMOTE_KEEP_LATEST=7
```
Upload an encrypted backup to S3:
Upload an encrypted backup to S3-compatible object storage with rclone:
```bash
chmod +x ./scripts/backup-upload-s3.sh
./scripts/backup-upload-s3.sh
```
After a successful upload, the remote storage keeps only the latest `BACKUP_REMOTE_KEEP_LATEST` encrypted `.tar.gz.enc` files. The server keeps only the latest `BACKUP_LOCAL_KEEP_LATEST` plaintext `.tar.gz` files under `./backups/latest/`; encrypted backup files are not kept locally.
Restore the latest encrypted backup from S3:
```bash