|
|
@@ -23,9 +23,9 @@
|
|
|
mkdir -p /mnt/old-roots
|
|
|
|
|
|
# Move current root to old-roots with current timestamp
|
|
|
- if [[ -e /mnt/@root && ! -e /mnt/@root-blank ]]; then
|
|
|
+ if [[ -e /mnt/@root ]]; then
|
|
|
timestamp=$(date +%Y-%m-%d_%H:%M:%S)
|
|
|
- if ! mv /mnt/@root "/mnt/old-roots/@root-$timestamp"; then
|
|
|
+ if ! btrfs subvolume snapshot -r /mnt/@root "/mnt/old-roots/@root-$timestamp"; then
|
|
|
echo "Failed to move /mnt/@root to old-roots"
|
|
|
umount /mnt
|
|
|
exit 1
|