Switch backup system to autorestic
This commit is contained in:
parent
c6fafa34c9
commit
6da8d4336b
6 changed files with 4 additions and 77 deletions
2
.bin/.e
2
.bin/.e
|
@ -5,8 +5,8 @@ declare -A mapper=(
|
|||
[".t"]="$HOME/.bin/.t"
|
||||
["alacritty"]="$HOME/.config/alacritty/alacritty.toml"
|
||||
["autoinstall.conf"]="$HOME/.config/autoinstall.conf"
|
||||
["autorestic"]="$HOME/.config/autorestic/.autorestic.yml"
|
||||
["autostart.toml"]="$HOME/.config/autostart.toml"
|
||||
["backup"]="$HOME/.bin/host-backup-$(cat /proc/sys/kernel/hostname)"
|
||||
["bash"]="$HOME/.bashrc"
|
||||
["bspwm"]="$HOME/.config/bspwm/bspwmrc"
|
||||
["completions"]="$HOME/.config/completionsrc"
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
|
||||
_hostname="$(cat /proc/sys/kernel/hostname)"
|
||||
_host_backup_file="host-backup-$_hostname"
|
||||
if [ -x "$( which "$_host_backup_file")" ]
|
||||
then
|
||||
# shellcheck disable=SC1090
|
||||
. "$_host_backup_file"
|
||||
else
|
||||
echo "No host-backup file found: $_host_backup_file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
host_backup_run
|
||||
sleep 3
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
"_forget")
|
||||
host-backup forget --prune --group-by "host" \
|
||||
--keep-last 14 \
|
||||
--keep-daily 60 \
|
||||
--keep-weekly 24 \
|
||||
--keep-monthly 36 \
|
||||
--keep-yearly 10
|
||||
;;
|
||||
*)
|
||||
restic "$@"
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
modes="monitor-std
|
||||
monitor-single
|
||||
monitor-single-sec
|
||||
zellij"
|
||||
|
||||
portalo_mode_monitor () {
|
||||
echo "Loading portalo monitor layout ${1:-std}"
|
||||
yadm config --unset-all local.class monitor-*
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
yadm config --add local.class "$1"
|
||||
fi
|
||||
|
||||
swaymsg reload
|
||||
}
|
||||
|
||||
portalo_mode_zellij () {
|
||||
layout_dir="$HOME/.config/zellij/layouts"
|
||||
layouts=$(\ls -1 "$layout_dir")
|
||||
layout=$(echo "$layouts" | $DMENU -p "layout")
|
||||
if [ -n "$layout" ]; then
|
||||
$TERMINAL -e zellij --layout="$layout_dir/$layout"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
mode=$(echo "$modes" | $DMENU -p "mode")
|
||||
else
|
||||
mode=$1
|
||||
fi
|
||||
|
||||
case $mode in
|
||||
"monitor-std") portalo_mode_monitor ;;
|
||||
"monitor-"*) portalo_mode_monitor "$mode" ;;
|
||||
"zellij") portalo_mode_zellij ;;
|
||||
*) echo "'$mode' is not a valid mode (single, std)" ;;
|
||||
esac
|
|
@ -9,7 +9,7 @@ autostart"
|
|||
action=$(echo "$actions" | $DMENU)
|
||||
|
||||
_menu_shutdown_backup() {
|
||||
alacritty -e "host-backup"
|
||||
alacritty -e sh -c "autorestic backup -av && sleep 3"
|
||||
}
|
||||
|
||||
if [ -z "$action" ]; then
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
autorestic
|
||||
cargo # rust
|
||||
#ckb-next # corsair hardware control
|
||||
#rustdesk # remote desktop tool # disabled for nightly from aur
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
.bin/host-backup-portalo
|
||||
.config/autorestic/.autorestic.yml##hostname.portalo,default
|
||||
.config/env.d/99-secrets
|
||||
.config/projectsrc
|
||||
.config/rclone/rclone.conf
|
||||
|
|
Loading…
Reference in a new issue