#!/usr/bin/env bash run_directory=$(dirname $(readlink -f "$0")) source "$run_directory/variables.conf" mount $containers_dir cd /var/lib/machines for filename in *; do systemctl start cont-snap@$filename.service btrfs subvolume delete $containers_dir/$filename/$(date -d "-15 days" +"%Y%m%d")* done umount $containers_dir exit 0