2 Angajamente 292180ccf0 ... 706335e43a

Autor SHA1 Permisiunea de a trimite mesaje. Dacă este dezactivată, utilizatorul nu va putea trimite nici un fel de mesaj Data
  Kevin Heinicke 706335e43a Add raspbi backup script 10 luni în urmă
  Kevin Heinicke a81f5e5f06 Latest updates 10 luni în urmă
4 a modificat fișierele cu 24 adăugiri și 5 ștergeri
  1. 20 0
      scripts/cron/raspi_backup_to_server.sh
  2. 0 4
      sheldon-plugins.toml
  3. 1 0
      zlogin
  4. 3 1
      zshrc

+ 20 - 0
scripts/cron/raspi_backup_to_server.sh

@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Basic snapshot-style rsync backup script
+
+# Config
+OPT="-aPhR --exclude='*cache*' --exclude='pihole-FTL.db'"
+SRC="/etc /root /home /var /usr/local/bin/backup.sh"
+SNAP="raspi-backup:"
+LAST="last"
+LINK="--link-dest=../$LAST"
+date=`date "+%Y-%m-%dT%T"`
+
+# Run rsync to create snapshot
+rsync $OPT $LINK $SRC ${SNAP}$date
+
+# Remove symlink to previous snapshot
+ssh raspi-backup "rm -f $LAST"
+
+# Create new symlink to latest snapshot for the next backup to hardlink
+ssh raspi-backup "ln -s $date $LAST"

+ 0 - 4
sheldon-plugins.toml

@@ -44,7 +44,3 @@ post = "source <(fzf --zsh | sed -e '/zmodload/s/perl/perl_off/' -e '/selected/s
 [plugins.docker-cli]
 github = "docker/cli"
 use = ["contrib/completion/zsh/_docker"]
-
-[plugins.azure-cli]
-github = "azure/azure-cli"
-use = ["az.completion"]

+ 1 - 0
zlogin

@@ -8,6 +8,7 @@ export HISTFILE=$HOME/.zhistory
 export SAVEHIST=20000
 export HISTSIZE=20000
 setopt HIST_EXPIRE_DUPS_FIRST
+setopt HIST_FIND_NO_DUPS
 setopt SHARE_HISTORY
 setopt EXTENDED_HISTORY
 

+ 3 - 1
zshrc

@@ -60,7 +60,9 @@ eval "$(direnv hook zsh)"
 [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
 
 # load homebrew autocompletions
-fpath=($(brew --prefix)/share/zsh/site-functions $fpath)
+if which brew > /dev/null; then
+  fpath=($(brew --prefix)/share/zsh/site-functions $fpath)
+fi
 
 # zplug load
 if which sheldon > /dev/null; then