Exoscale VM offsite backup
You must use jq, rclone and exo.
You must use rclone version ≥ 1.50.
- Setup exo with API keys
- Setup rclone remote config
Checks:
$ exo vm list
┼──────────────────────────────────────┼─────────────────────────────────────────┼───────┼─────────┼─────────┼─────────────────┼
│ ID │ NAME │ SIZE │ ZONE │ STATE │ IP ADDRESS │
┼──────────────────────────────────────┼─────────────────────────────────────────┼───────┼─────────┼─────────┼─────────────────┼
│ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx │ VM-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx │ Micro │ ch-dk-2 │ Stopped │ XXX.XXX.XXX.XXX │
┼──────────────────────────────────────┼─────────────────────────────────────────┼───────┼─────────┼─────────┼─────────────────┼
$ rclone lsd my_rclone_remote:
-1 2021-07-22 12:43:49 -1 my-bucket-or-folder
- Create snapshot from VM
- Transform snapshots to runnable VM image
- Exporting (thanks rclone) to another places (S3, Google Drive...)
- Purge old snapashots/backups
- Push snapshot metadata if rclone remote config is S3
Backup VM to one target:
./exobackup.sh myvmid rclone_remote:my/target/directory
Backup VM to many targets:
./exobackup.sh myvmid rclone_remote:my/target/directory rclone_remote_alt:my/another/directory
EXO_PATHRCLONE_PATH
EXOSCALE_ACCOUNT: Exoscale account, if many accounts are used. Checkexo config list.EXOSCALE_SNAPSHOTS_RETENTION_DAYS
RCLONE_DELETE_MIN_AGE(see rclone documentation)RCLONE_EXTRA_FLAGS: add flags to rclone
MIT
- Emilien Mantel for TripleStack