From 392f4e2046f9ec072a2cd5b4f2623791eb33c57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Sat, 7 Oct 2017 11:16:42 +0200 Subject: [PATCH] fix typo from test and add install.sh script --- btrfs-snapshots.sh | 2 +- install.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 install.sh diff --git a/btrfs-snapshots.sh b/btrfs-snapshots.sh index 456c16d..65586d2 100755 --- a/btrfs-snapshots.sh +++ b/btrfs-snapshots.sh @@ -6,7 +6,7 @@ TMP_MNT=${TMP_MNT:-/var/tmp/btrfs-backup} vols=() del= dryrun=0 -periodity=${a%/*} +periodity=${0%/*} periodity=${periodity##*/} if [[ $periodity =~ ^cron\... ]]; then periodity=${periodity#cron} diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..51fb569 --- /dev/null +++ b/install.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +for f in hourly daily weekly monthly; do + sudo cp btrfs-snapshots.sh /etc/cron.$f/btrfs-snapshots; +done