feat: bm runs all profiles, menu still available as backup-menu

This commit is contained in:
Dmitry
2026-05-13 20:11:38 +03:00
parent c5d13169d1
commit f24af95184
2 changed files with 12 additions and 7 deletions
+1 -6
View File
@@ -143,14 +143,9 @@ alias rsend='sudo rsync -avhP --stats'
alias wakemac='ssh vps "wakeonlan -i 192.168.1.255 FC:34:97:E1:08:E9"' alias wakemac='ssh vps "wakeonlan -i 192.168.1.255 FC:34:97:E1:08:E9"'
# ═══ Пользовательские скрипты ══════════════════════════════ # ═══ Пользовательские скрипты ══════════════════════════════
alias bm='backup-menu' alias bm='backup-menu --all'
alias sp='ssh-pick' alias sp='ssh-pick'
# Использовать bat вместо cat, если установлен
if command -v bat &>/dev/null; then
alias cat='bat'
fi
# Быстрое обновление системы (для разных дистрибутивов) # Быстрое обновление системы (для разных дистрибутивов)
if command -v apt &>/dev/null; then if command -v apt &>/dev/null; then
alias update='sudo apt update && sudo apt upgrade -y' alias update='sudo apt update && sudo apt upgrade -y'
+11 -1
View File
@@ -44,13 +44,23 @@ _show_snapshots() {
resticprofile -n "$profile" snapshots 2>&1 | less resticprofile -n "$profile" snapshots 2>&1 | less
} }
_run_all() {
for p in "${PROFILES[@]}"; do
_run_backup "$p"
done
}
main() { main() {
if [[ "${1:-}" == "--all" ]]; then
_run_all
return
fi
if ! command -v fzf &>/dev/null; then if ! command -v fzf &>/dev/null; then
echo "fzf not found" echo "fzf not found"
exit 1 exit 1
fi fi
# Build profile list with last run info
local lines=() local lines=()
for p in "${PROFILES[@]}"; do for p in "${PROFILES[@]}"; do
lines+=("$(_profile_label "$p")") lines+=("$(_profile_label "$p")")