#!/bin/sh if [ "$ramroot" = "" ]; then echo "Use only with ramroot-admin" exit 1 fi prev="$1" new="$2" desc="$3" if [ ! -d "$ramroot/snapshot/$prev" ]; then echo "Old snapshot $prev does not exist" exit 1 fi if [ -d "$ramroot/snapshot/$new" ]; then echo "New snapshot already exists" exit 1 fi echo "#${new} `date +"%Y-%m-%d %H:%M"` ${desc}" > /etc/ramroot/grub-title mount -o remount,rw $ramroot rsync --numeric-ids -ax --delete --link-dest=../${prev} --exclude $ramroot / $ramroot/snapshot/${new} mount -o remount,ro $ramroot