This repository has been archived on 2025-02-14. You can view files and clone it, but cannot push or open issues or pull requests.
pyinfra-lxd/files/lxd-export.sh
2021-02-13 20:31:28 +09:00

10 lines
290 B
Bash

#!/usr/bin/env bash
set -euo pipefail
cd /var/backups/lxd
for i in $(lxc list --format csv -c n); do
# Don't use --optimized-storage as Borg will not be able to compress or chunk
# it properly
echo "Backuping ${i}..."
lxc export $i ${i}.tar --instance-only --compression none
done