This commit is contained in:
teldra 2021-04-18 11:38:18 +02:00
parent 304f7522f2
commit effda2cfae
8 changed files with 44 additions and 28 deletions

1
config
View File

@ -5,6 +5,7 @@ i3wm_apps="claws-mail galculator-gtk3"
lastminute() {
echo "Do lastminute changes.."
#addpkg thunderbird-i18n-de
addpkg mpv mpv-mpris
servicesenable sshd
#servicesdisable
#ignorepkg

View File

@ -2,13 +2,42 @@
export LANG="en_US.UTF-8"
backupcfg="/etc/backup.cfg"
ziel="/var/lib/backup/ziel"
cfg="/etc/btrbk/btrbk.conf.system"
cfg="/etc/btrbk/btrbk.conf.void"
fhelp() {
echo "Nutze es so:"
echo "sudo backup"
echo "sudo backup poweroff (um den Rechner nach dem Backup herunterzufahren.)"
#echo "sudo backup update (um den Rechner nach dem Backup up zu daten.)"
#echo "update und poweroff sind mixbar"
echo "sudo backup passwd (um das Passwort für die Backupfestplatte zu ändern.)"
}
if [ "${UID}" -ne "0" ]; then
echo "Keine Rootrechte."
exit 1
fi
if [[ -f /etc/btrbk/btrbk.conf ]]; then
function finish {
sync
if [ "${poweroff}" = "y" ]; then
shutdown -h now
fi
sleep 4
echo "FERTIG"
rm -rf /tmp/backup
}
trap finish EXIT
if ! btrbk --progress --quiet run backup; then
btrbk --progress --quiet clean
echo "Wegen Fehler nicht herunterfahren."
poweroff=n
fi
exit
fi
if [[ -f "${backupcfg}" ]]; then
source "${backupcfg}"
else
@ -19,23 +48,12 @@ else
echo "\`void-createbackupcontainer\` um eine neue Backupplatte einzurichten."
fi
if [[ -f /etc/btrbk/btrbk.conf ]]; then
cfg="/etc/btrbk/btrbk.conf"
fi
if [ -z "${UUID}" ]; then
echo "Keine Backupplatte angegeben."
exit 1
fi
fhelp() {
echo "Nutze es so:"
echo "sudo backup"
echo "sudo backup poweroff (um den Rechner nach dem Backup herunterzufahren.)"
#echo "sudo backup update (um den Rechner nach dem Backup up zu daten.)"
#echo "update und poweroff sind mixbar"
echo "sudo backup passwd (um das Passwort für die Backupfestplatte zu ändern.)"
}
if [ ! -e "/dev/disk/by-uuid/${UUID}" ]; then
echo "Bitte Backupfestplatte anschliessen."

View File

@ -4,18 +4,18 @@ if [ "${UID}" -ne "0" ]; then
exit 1
fi
if [ -f /etc/btrbk/btrbk.conf ]; then
cfg="/etc/btrbk/btrbk.conf"
else
cfg="/etc/btrbk/btrbk.conf.system"
fi
cfg="/etc/btrbk/btrbk.conf.void"
if mountpoint -q /var/lib/backup/quelle/bootfs; then
snapshotbootfs="snapshotbootfs"
if [ -f /etc/btrbk/btrbk.conf ]; then
btrbk --progress --quiet run snapshot
else
if mountpoint -q /var/lib/backup/quelle/bootfs; then
snapshotbootfs="snapshotbootfs"
fi
for s in snapshotrootfs "${snapshotbootfs}"; do
test "${s}" && btrbk --config="${cfg}" --quiet run "${s}"
done
fi
for s in snapshotrootfs "${snapshotbootfs}"; do
test "${s}" && btrbk --config="${cfg}" --quiet run "${s}"
done
if ! sudo update-grub 2> /dev/null; then
echo update-grub failed

View File

@ -0,0 +1 @@
appendpath '${HOME}/local/bin'

View File

@ -1,5 +0,0 @@
User_Alias BACKUPGROUP = %_backshot
Cmnd_Alias BACKUP = /usr/bin/btrbk, /usr/bin/btrfs, /usr/bin/readlink, /usr/bin/update-grub, /usr/bin/mount
BACKUPGROUP ALL = NOPASSWD: BACKUP

BIN
lala Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
declare -f lastminute