Add system backup script
This commit is contained in:
parent
fdab59610f
commit
31390a0749
3 changed files with 43 additions and 2 deletions
|
|
@ -56,7 +56,6 @@ go-mtpfs-git
|
|||
greetd-tuigreet
|
||||
grim
|
||||
grub
|
||||
grub-btrfs
|
||||
gst-plugin-pipewire
|
||||
gtk4
|
||||
gtklock
|
||||
|
|
|
|||
42
scripts/backup.sh
Executable file
42
scripts/backup.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
|
||||
echo "[*] Export des paquets"
|
||||
pacman -Qqe > "$REPO_DIR/pkglist/pacman.txt"
|
||||
pacman -Qqm > "$REPO_DIR/pkglist/aur.txt"
|
||||
|
||||
echo "[*] Export des services systemd"
|
||||
systemctl list-unit-files --state=enabled \
|
||||
> "$REPO_DIR/systemd/enabled-system.txt"
|
||||
|
||||
systemctl --user list-unit-files --state=enabled \
|
||||
> "$REPO_DIR/systemd/enabled-user.txt"
|
||||
|
||||
echo "[*] Sauvegarde des fichiers système"
|
||||
|
||||
sudo rsync -a \
|
||||
/etc/pacman.conf \
|
||||
/etc/makepkg.conf \
|
||||
/etc/mkinitcpio.conf \
|
||||
/etc/fstab \
|
||||
/etc/nftables.conf \
|
||||
"$REPO_DIR/rootfs/etc/"
|
||||
|
||||
sudo rsync -a \
|
||||
/etc/snapper/configs/root \
|
||||
"$REPO_DIR/rootfs/etc/snapper/configs/"
|
||||
|
||||
sudo rsync -a \
|
||||
/etc/systemd/system/battery-threshold.service \
|
||||
"$REPO_DIR/rootfs/etc/systemd/system/"
|
||||
|
||||
sudo rsync -a \
|
||||
/boot/limine.conf \
|
||||
"$REPO_DIR/rootfs/boot/"
|
||||
|
||||
sudo chown -R "$USER:$USER" "$REPO_DIR"
|
||||
|
||||
echo "[+] Sauvegarde terminée"
|
||||
|
|
@ -31,4 +31,4 @@ fstrim.timer enabled disabled
|
|||
snapper-cleanup.timer enabled disabled
|
||||
snapper-timeline.timer enabled disabled
|
||||
|
||||
32 unit files listed.
|
||||
31 unit files listed.
|
||||
|
|
|
|||
Loading…
Reference in a new issue