Separate config file

Started implementing separate config file. Needs to be copied/linked
manually to /etc/snapsh.conf
This commit is contained in:
Jarno Rankinen 2020-08-07 06:58:16 +03:00
parent 7ac0180fd6
commit 1770fe4e56
2 changed files with 36 additions and 5 deletions

16
snapsh
View File

@ -18,13 +18,19 @@
# Environment set up:
TOPLEVEL="/root/btrfs-toplevel"
SNAPSHOTS_LOCATION="/root/btrfs-toplevel/snapshots"
if [[ -e /etc/snapsh.conf ]]; then
. /etc/snapsh.conf
else
TOPLEVEL="/root/btrfs-toplevel"
SNAPSHOTS_LOCATION="/root/btrfs-toplevel/snapshots"
TIMESTAMP="$(date +%Y.%m.%d-%H.%M.%S)"
SUBVOLUME="root"
DESCRIPTION=""
fi
## In case of problems, define the path to the 'btrfs' executable here
BTRFS_EXECUTABLE=$(which btrfs)
TIMESTAMP=$(date +%Y.%m.%d-%H:%M:%S)
SUBVOLUME="root"
DESCRIPTION=""

25
snapsh.conf Normal file
View File

@ -0,0 +1,25 @@
## Snapsh requires the toplevel (subvolid=5) mounted somewhere
## You can define your mount point here.
## Default: "/root/btrfs-toplevel"
TOPLEVEL="/root/btrfs-toplevel"
## You should create a subvolume for snapshots. Snapsh will do this
## automatically, define the subvolume here. It is recommended
## to have the subvolume directly under the btrfs root (id=5)
## Use the full path
## Default: "/root/"
SNAPSHOTS_LOCATION="/root/btrfs-toplevel/snapshots"
## Timestamp format. See 'date --help' for formatting options.
## This will only be used for the name of the snapshot (=subvolume)
## created. E.g. with default setting snapshots will be created as
## "/root/btrfs-toplevel/snapshots/root_snapshot_2020_07_31-01.59.23"
## Default: $(date +%Y.%m.%d-%H.%M.%S)
TIMESTAMP="$(date +%Y.%m.%d-%H.%M.%S)"
## Experimental:
## Define the list of subvolumes to be handled by snapsh here.
## Defaut: (root home)
SUBVOLUMES=(root home)