create basic configuration file
This commit is contained in:
parent
02a37e8289
commit
976d440616
4 changed files with 11 additions and 19 deletions
1
install
1
install
|
|
@ -32,4 +32,5 @@ install -Dm 755 snap-pac-clean $SCRIPTS_DIR
|
|||
install -Dm 644 10_snapper-pre.hook $HOOKS_DIR
|
||||
install -Dm 644 10_snapper-post.hook $HOOKS_DIR
|
||||
install -Dm 644 20_snap-pac-clean.hook $HOOKS_DIR
|
||||
install -Dm 644 snap-pac.conf /etc/
|
||||
install -Dm 644 LICENSE "$INSTALL_DIR/usr/share/licenses/snap-pac/LICENSE"
|
||||
|
|
|
|||
|
|
@ -20,5 +20,6 @@
|
|||
|
||||
# Takes a snapper pre snapshot before a pacman transaction
|
||||
|
||||
rm /usr/share/libalpm/hooks.bin/snap-pac/.pre*
|
||||
source /etc/snap-pac.conf
|
||||
rm "$PREFIX_PREFILE"*
|
||||
echo "NOTE: No post snapshot will be performed for this transaction, since you are removing the pacman hooks."
|
||||
|
|
|
|||
17
snapper-post
17
snapper-post
|
|
@ -20,19 +20,14 @@
|
|||
|
||||
# Takes a snapper post snapshot after a pacman transaction
|
||||
|
||||
# Change this variable to include other configs in the post snapshot
|
||||
# You must also change it in the pre snapshot script
|
||||
CONFIGS="root"
|
||||
#CONFIGS="root home"
|
||||
source /etc/snap-pac.conf
|
||||
|
||||
PACMAN_CMD=$(ps -C pacman -o args=)
|
||||
PREFILE=/usr/share/libalpm/hooks.bin/snap-pac/.pre
|
||||
for x in $CONFIGS; do
|
||||
if [ -f $PREFILE"_"$x ]; then
|
||||
SNAPPERPACPRE=$(cat $PREFILE"_"$x)
|
||||
snapper --config $x create --cleanup-algorithm number --type post --pre-number $SNAPPERPACPRE --description "$PACMAN_CMD"
|
||||
rm $PREFILE"_"$x
|
||||
if [ -f $PREFILE_PREFIX"_"$x ]; then
|
||||
SNAPPERPACPRE=$(cat $PREFILE_PREFIX"_"$x)
|
||||
snapper --config $x create --cleanup-algorithm number --type post --pre-number $SNAPPERPACPRE --description "$PRE_DESCRIPTION"
|
||||
rm $PREFILE_PREFIX"_"$x
|
||||
else
|
||||
echo "WARNING: $PREFILE"_"$x does not exist, so not performing post snapshot. If you are initially installing snap-pac, this is normal."
|
||||
echo "WARNING: $PREFILE_PREFIX"_"$x does not exist, so not performing post snapshot. If you are initially installing snap-pac, this is normal."
|
||||
fi
|
||||
done
|
||||
|
|
|
|||
|
|
@ -20,13 +20,8 @@
|
|||
|
||||
# Takes a snapper pre snapshot before a pacman transaction
|
||||
|
||||
# Change this variable to include other configs in the pre snapshot
|
||||
# You must also change it in the post snapshot script
|
||||
CONFIGS="root"
|
||||
#CONFIGS="root home"
|
||||
source /etc/snap-pac.conf
|
||||
|
||||
PACMAN_CMD=$(ps -C pacman -o args=)
|
||||
PREFILE=/usr/share/libalpm/hooks.bin/snap-pac/.pre
|
||||
for x in $CONFIGS; do
|
||||
snapper --config $x create --type pre --cleanup-algorithm number --print-number --description "$PACMAN_CMD" > $PREFILE"_"$x
|
||||
snapper --config $x create --type pre --cleanup-algorithm number --print-number --description "$POST_DESCRIPTION" > $PREFILE_PREFIX"_"$x
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue