Skip to content

Instantly share code, notes, and snippets.

View mbuiro's full-sized avatar

Michael Ezebuiro mbuiro

View GitHub Profile
@mbuiro
mbuiro / lxd-backup.sh
Last active March 22, 2020 17:45
Very basic script to backup lxd containers to tar file
#!/bin/bash
DATE=`date +%m-%d-%Y`
OLD_DATE=`date +%m-%d-%Y -d "7 day ago"`
BACKUP_DIR=/var/backups/containers
if [ ! -d "$BACKUP_DIR" ]; then
mkdir -p $BACKUP_DIR
fi
for i in $(ls /var/snap/lxd/common/lxd/containers); do