$(DESTDIR)$(PREFIX)/sbin
install -p -o $(USER) -g $(GROUP) -m 755 btrfs-mksnapshot \
$(DESTDIR)$(PREFIX)/sbin/btrfs-mksnapshot
+ install -p -o $(USER) -g $(GROUP) -m 755 btrfs-mksnapshot-rootfs \
+ $(DESTDIR)$(PREFIX)/sbin/btrfs-mksnapshot-rootfs
install -d -o $(USER) -g $(GROUP) -m 755 \
$(DESTDIR)/etc/apt/apt.conf.d
install -p -o $(USER) -g $(GROUP) -m 644 06btrfs-mksnapshot \
--- /dev/null
+#!/bin/bash -e
+#
+# btrfs-mksnapshot-rootfs -- Make snapshots of root filesystems ("/")
+# Copyright (c)2014 Alexander Barton (alex@barton.de)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+NAME=`basename "$0"`
+
+function Usage()
+{
+ echo "Usage: $NAME"; echo
+ exit 1
+}
+
+[ $# -eq 0 ] || Usage
+
+if [ -n "`fgrep ' / btrfs ' /etc/fstab 2>/dev/null`" ]; then
+ if [ -x /usr/local/sbin/btrfs-mksnapshot ]; then
+ /usr/local/sbin/btrfs-mksnapshot -1 / || exit 1
+ else
+ echo "\"/usr/local/sbin/btrfs-mksnapshot\" not executable, snapshot creation skipped."
+ fi
+else
+ echo "Root filesystem is not ot type \"btrfs\", snapshot creation skipped."
+fi
+exit 0