Jarno Rankinen
0633f5066b
Instructions for adding description added |
||
---|---|---|
LICENSE | ||
README.md |
README.md
snapsh
Btrfs snapshot managing bash script
Requirements:
bash
- GNU
setopt
- part of GNUcoreutils
btrfs-progs
- Userspace programs for btrfs
Instructions:
- Script needs the toplevel subvolume (id=5) mounted somewhere. Default location is
/root/btrfs-toplevel
, but you can mount it anywhere you like and define it withTOPLEVEL
variable. (A separate config file will be implemented later). - Will create a subvolume named snapshots by default to the toplevel. This can also be changed with
SNAPSHOTS_LOCATION
. - Display usage instructions with
snapsh -h
orsnapsh --help
- Taking snapshots requires root priviledges. Take a snapshot with
snapsh -s SUBVOLUME
orsnapsh --snapshot SUBVOLUME
, whereSUBVOLUME
is the name of the source subvolume. You can add a description for the snapshot with the-d | --description
option (must be used before the-s
option)
Example with Fedora default btrfs layout withroot
andhome
subvolumes:
snapsh -d "This is a snapshot" -s root
This will create a snapshot calledroot_snapshot_YYYY.MM.DD-hh:mm:ss
to thesnapshots
subvolume (or the one you defined withSNAPSHOTS_LOCATION
), with a description "This is a snapshot"