udpate docs, rm unneeded checks
This commit is contained in:
parent
a54039effe
commit
325c8f45c3
2 changed files with 13 additions and 41 deletions
|
|
@ -100,12 +100,12 @@ Installing the nano package as normal:
|
||||||
(1/1) checking available disk space [######################################] 100%
|
(1/1) checking available disk space [######################################] 100%
|
||||||
:: Running pre-transaction hooks...
|
:: Running pre-transaction hooks...
|
||||||
(1/1) Performing snapper pre snapshots for the following configurations...
|
(1/1) Performing snapper pre snapshots for the following configurations...
|
||||||
root: 1033
|
=> root: 1033
|
||||||
:: Processing package changes...
|
:: Processing package changes...
|
||||||
(1/1) installing nano [######################################] 100%
|
(1/1) installing nano [######################################] 100%
|
||||||
:: Running post-transaction hooks...
|
:: Running post-transaction hooks...
|
||||||
(1/1) Performing snapper post snapshots for the following configurations...
|
(1/1) Performing snapper post snapshots for the following configurations...
|
||||||
root: 1034
|
=> root: 1034
|
||||||
|
|
||||||
.EE
|
.EE
|
||||||
|
|
||||||
|
|
@ -163,17 +163,16 @@ And nano is now gone, along with all the files it changed:
|
||||||
|
|
||||||
.SH TROUBLESHOOTING
|
.SH TROUBLESHOOTING
|
||||||
|
|
||||||
.SS ERROR: \fI/etc/conf.d/snapper\fR does not exist!
|
.SS error: No dbus available. Are you in a chroot environment?
|
||||||
snap-pac reads in the snapper configurations from \fI/etc/conf.d/snapper\fR. It can't
|
Snapper requires dbus. If you chroot into another environment, dbus will not be
|
||||||
do that if the file doesn't exist. I'm not sure what you've done to not have it
|
available, so snapper can't take snapshots. Although snapper can be set up to
|
||||||
exist in the default location.
|
not need dbus, this is a simple way to check if one is in a chroot and avoid
|
||||||
|
attempting snapshots in it.
|
||||||
|
|
||||||
.SS WARNING: No snapper configurations found, so not taking any snapshots!
|
.SS snap-pac is only taking snapshots of the root configuration
|
||||||
No snapper configurations were found in \fI/etc/conf.d/snapper\fR. This means you
|
That's the default behavior. See \fBCONFIGURATION\fR.
|
||||||
haven't created any configurations yet using snapper create-config. See the
|
|
||||||
snapper manpage on how to do this.
|
|
||||||
|
|
||||||
.SS WARNING: No snapper configurations are set up for snapshots to be taken!
|
.SS No snapshots are being taken when I run pacman
|
||||||
Although you seem to have created at least one snapper configuration, none of
|
Although you seem to have created at least one snapper configuration, none of
|
||||||
them are set up for snap-pac's pacman hooks. By default snap-pac will take
|
them are set up for snap-pac's pacman hooks. By default snap-pac will take
|
||||||
snapshots for the root configuration and any other configuration which has
|
snapshots for the root configuration and any other configuration which has
|
||||||
|
|
@ -181,30 +180,10 @@ PACMAN_PRE_POST set to yes in its configuration file. This message means you
|
||||||
don't have a snapper configuration named root (or PACMAN_PRE_POST is set to no
|
don't have a snapper configuration named root (or PACMAN_PRE_POST is set to no
|
||||||
for it) and no other configuration is set up for snapshots. See configuration.
|
for it) and no other configuration is set up for snapshots. See configuration.
|
||||||
|
|
||||||
.SS WARNING: prefile does not exist, so no post snapshot will be taken. If you are initially installing snap-pac, this is normal.
|
|
||||||
snap-pac saves the pre snapshot's number in a temporary file. Somehow it got
|
|
||||||
removed before the post snapshot could be taken. When you initially install
|
|
||||||
snap-pac the post hook is run, but the pre hook never was, so this message will
|
|
||||||
show up then as well and is safe to ignore in that circumstance.
|
|
||||||
|
|
||||||
.SS WARNING: Didn't find pacman running.
|
|
||||||
The script gets the description from the pacman command that was run. If you get
|
|
||||||
this warning it looks like you may have run the script directly instead of
|
|
||||||
letting it run through pacman's hooks.
|
|
||||||
|
|
||||||
.SS ERROR: Unable to use snapper without dbus. Are you in a chroot environment?
|
|
||||||
Snapper requires dbus. If you chroot into another environment, dbus will not be
|
|
||||||
available, so snapper can't take snapshots. Although snapper can be set up to
|
|
||||||
not need dbus, this is a simple way to check if one is in a chroot and avoid
|
|
||||||
attempting snapshots in it.
|
|
||||||
|
|
||||||
.SS After restoring snapshot from snap-pac, pacman database is locked
|
.SS After restoring snapshot from snap-pac, pacman database is locked
|
||||||
The pre/post snaphots are taken while pacman is running, so this is expected.
|
The pre/post snaphots are taken while pacman is running, so this is expected.
|
||||||
Follow the instructions pacman gives you (e.g., removing the lock file).
|
Follow the instructions pacman gives you (e.g., removing the lock file).
|
||||||
|
|
||||||
.SS snap-pac is only taking snapshots of the root configuration
|
|
||||||
That's the default behavior. See \fBCONFIGURATION\fR.
|
|
||||||
|
|
||||||
.SH FAQ
|
.SH FAQ
|
||||||
.SS Does snap-pac backup non-btrfs /boot partitions?
|
.SS Does snap-pac backup non-btrfs /boot partitions?
|
||||||
Nope. But you can add hook that does it for you. It would be something like the
|
Nope. But you can add hook that does it for you. It would be something like the
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,21 @@
|
||||||
# snap-pac
|
# snap-pac
|
||||||
# https://github.com/wesbarnett/snap-pac
|
# https://github.com/wesbarnett/snap-pac
|
||||||
# Copyright (C) 2016, 2017 James W. Barnett
|
# Copyright (C) 2016, 2017 James W. Barnett
|
||||||
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
# You should have received a copy of the GNU General Public License along
|
# You should have received a copy of the GNU General Public License along
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
# Main script.
|
|
||||||
|
|
||||||
declare -r SNAPPER_CONFIG_FILE=/etc/conf.d/snapper
|
declare -r SNAPPER_CONFIG_FILE=/etc/conf.d/snapper
|
||||||
declare -r DESC_LIMIT=48
|
declare -r DESC_LIMIT=48
|
||||||
declare -r name="snap-pac"
|
declare -r name="snap-pac"
|
||||||
|
|
@ -58,7 +56,6 @@ set_defaults() {
|
||||||
trap error_exit ERR
|
trap error_exit ERR
|
||||||
trap kill_exit SIGTERM SIGINT
|
trap kill_exit SIGTERM SIGINT
|
||||||
|
|
||||||
[[ "$pre_or_post" != "pre" ]] && [[ "$pre_or_post" != "post" ]] && die "First argument must be 'pre' or 'post'."
|
|
||||||
[[ ! -d /var/run/dbus ]] && die "No dbus available. Are you in a chroot environment?"
|
[[ ! -d /var/run/dbus ]] && die "No dbus available. Are you in a chroot environment?"
|
||||||
|
|
||||||
source "$SNAPPER_CONFIG_FILE"
|
source "$SNAPPER_CONFIG_FILE"
|
||||||
|
|
@ -73,8 +70,6 @@ for CONFIG in $SNAPPER_CONFIGS; do
|
||||||
prefile="/tmp/$name-pre_$CONFIG"
|
prefile="/tmp/$name-pre_$CONFIG"
|
||||||
snapper_cmd="snapper --config $CONFIG create --type $pre_or_post --cleanup-algorithm $PACMAN_CLEANUP_ALGORITHM --print-number --description"
|
snapper_cmd="snapper --config $CONFIG create --type $pre_or_post --cleanup-algorithm $PACMAN_CLEANUP_ALGORITHM --print-number --description"
|
||||||
|
|
||||||
x=$((x+1))
|
|
||||||
|
|
||||||
if [[ "$pre_or_post" == "pre" ]]; then
|
if [[ "$pre_or_post" == "pre" ]]; then
|
||||||
printf "==> %s: $($snapper_cmd "$(truncate_description $PACMAN_PRE_DESCRIPTION)" | tee "$prefile")\n" "$CONFIG"
|
printf "==> %s: $($snapper_cmd "$(truncate_description $PACMAN_PRE_DESCRIPTION)" | tee "$prefile")\n" "$CONFIG"
|
||||||
elif [[ -f $prefile && "$pre_or_post" == "post" ]]; then
|
elif [[ -f $prefile && "$pre_or_post" == "post" ]]; then
|
||||||
|
|
@ -84,6 +79,4 @@ for CONFIG in $SNAPPER_CONFIGS; do
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
[[ $x -eq 0 ]] && die "No snapper configurations are set up for snapshots to be taken."
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue