From c19e729f9406e1d51162f27e205f79d3a9f212d3 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 5 Nov 2025 00:40:03 -0600 Subject: [PATCH] test: impermanence --- systems/ceres/config/filesystem.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/systems/ceres/config/filesystem.nix b/systems/ceres/config/filesystem.nix index ef0b7c4..184f43c 100755 --- a/systems/ceres/config/filesystem.nix +++ b/systems/ceres/config/filesystem.nix @@ -40,10 +40,10 @@ in mkdir -p /btrfs_tmp mount -o subvol=/ /dev/disk/by-label/root /btrfs_tmp - if [[ -e /btrfs_tmp/@ ]]; then - mkdir -p /btrfs_tmp/@old_roots - timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/@)" "+%Y-%m-%d_%H:%M:%S") - mv /btrfs_tmp/@ "/btrfs_tmp/@old_roots/$timestamp" + if [[ -e /btrfs_tmp/root ]]; then + mkdir -p /btrfs_tmp/old_roots + timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%d_%H:%M:%S") + mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" fi delete_subvolume_recursively() { @@ -54,11 +54,11 @@ in btrfs subvolume delete "$1" } - for i in $(find /btrfs_tmp/@old_roots/ -maxdepth 1 -mtime +30 2>/dev/null); do + for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30 2>/dev/null); do delete_subvolume_recursively "$i" done - btrfs subvolume create /btrfs_tmp/@ + btrfs subvolume create /btrfs_tmp/root umount /btrfs_tmp '';