scripts

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 3ec5ac2cf2423ba0a0c1e8d440581cb94145f0dc
parent 0bdd3f9d0c9dba167bb86dec7a5849eafdfaf1ce
Author: Andrew Laack <andrew@laack.co>
Date:   Thu, 19 Feb 2026 03:14:42 -0600

Better backups

Diffstat:
Rbackup.sh -> backups/old/backup.sh | 0
RbackupHelper.sh -> backups/old/backupHelper.sh | 0
RbackupHome.sh -> backups/old/backupHome.sh | 0
Rsync.sh -> backups/old/sync.sh | 0
Abackups/pull.sh | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Minstallers/arch-private-installation.sh | 6++++++
Minstallers/arch-public-installation.sh | 2+-
Mstatusbar.sh | 3++-
8 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/backup.sh b/backups/old/backup.sh diff --git a/backupHelper.sh b/backups/old/backupHelper.sh diff --git a/backupHome.sh b/backups/old/backupHome.sh diff --git a/sync.sh b/backups/old/sync.sh diff --git a/backups/pull.sh b/backups/pull.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +backup-vps () { + # Website + blog + mkdir -p /home/backup/vps/srv + rsync -v --delete --recursive root@laack.co:/srv/ /home/backup/vps/srv + + # Forgejo + mkdir -p /home/backup/vps/var + rsync -v --delete --recursive root@laack.co:/srv/ /home/backup/vps/var + + # Other configuration + mkdir -p /home/backup/vps/etc + rsync -v --delete --recursive root@laack.co:/srv/ /home/backup/vps/etc +} + +shared-directories() { + # These are files that should be shared, source of truth is brgr + rsync -v --delete --recursive andrew@brgr:/home/andrew/personal-files ~ +} + +backup-brgr() { + + # These are private git repos + mkdir -p /home/backup/brgr/srv + rsync -v --delete --recursive andrew@brgr:/srv/ /home/backup/brgr/srv + + # Home directory + mkdir -p /home/backup/brgr/home + rsync -v --delete --recursive andrew@brgr:/home/andrew /home/backup/brgr/home + +} + +backup-deepthought() { + mkdir -p /home/backup/deepthought/home + rsync -v --delete --recursive andrew@deepthought:/home/andrew /home/backup/deepthought/home +} + +if [ -n "$(hostnamectl | grep deepthought)" ] ; then + backup-vps + backup-brgr + shared-directories +fi + +# BRGR is source of truth for shared-directories +if [ -n "$(hostnamectl | grep brgr)" ] ; then + backup-vps + backup-deepthought +fi diff --git a/installers/arch-private-installation.sh b/installers/arch-private-installation.sh @@ -16,3 +16,9 @@ git config --global user.email "andrew@laack.co" git config --global user.name "Andrew Laack" git config --global credential.helper cache git config --global credential.helper 'cache --timeout=30000' + +cp ~/gitRepos/keys/ssh/id_ed25519* ~/.ssh/ +chmod 600 ~/.ssh/id_ed25519* + +sudo mkdir /home/backup +sudo chown andrew /home/backup diff --git a/installers/arch-public-installation.sh b/installers/arch-public-installation.sh @@ -1,7 +1,7 @@ #!/bin/bash # Full arch installer (publicly accessible resources only) -sudo pacman -S git gcc make xorg-server libxft libxinerama freetype2 pkgconf ttf-fira-code zoxide fzf openssh less arandr dmenu pass pass-otp xclip newsboat xorg-xsetroot base-devel i3lock pandoc zathura entr ripgrep wget jq man-db btop tmux +sudo pacman -S git gcc make xorg-server libxft libxinerama freetype2 pkgconf ttf-fira-code zoxide fzf openssh less arandr dmenu pass pass-otp xclip newsboat xorg-xsetroot base-devel i3lock pandoc zathura entr ripgrep wget jq man-db btop tmux rsync mkdir gitRepos cd gitRepos diff --git a/statusbar.sh b/statusbar.sh @@ -2,4 +2,5 @@ # this is called in a loop that runs in the background from xinitrc. -xsetroot -name "$(cat ~/logs/backup-status.log) | $(date)" +#xsetroot -name "$(cat ~/logs/backup-status.log) | $(date)" +xsetroot -name "$(date)"