feat: i3 update & other minor stuff
This commit is contained in:
parent
28ca2f79be
commit
c9010fe697
9 changed files with 169 additions and 73 deletions
8
crates/90-backups/crate.debian.sh
Normal file
8
crates/90-backups/crate.debian.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
apply() {
|
||||
echo "------------ WARNING ------------"
|
||||
echo "BACKUPS ARE NOT SETUP ON DEBIAN! "
|
||||
echo " PLEASE SETUP MANUALLY "
|
||||
echo "---------------------------------"
|
||||
}
|
4
crates/90-backups/crate.sh
Normal file
4
crates/90-backups/crate.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="Setup restic backups"
|
||||
scripts="@distro" # only distro
|
41
crates/90-backups/scripts/backup.sh
Normal file
41
crates/90-backups/scripts/backup.sh
Normal file
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
|
||||
log() {
|
||||
echo "log: $@"
|
||||
if [ -f "/var/backups/ntfy.env" ]; then
|
||||
. /var/backups/ntfy.env
|
||||
curl \
|
||||
-s \
|
||||
-d "$@" \
|
||||
${NTFY_URL:-https://push.ixvd.net/logs}
|
||||
fi
|
||||
}
|
||||
|
||||
log starting backup for $HOSTNAME
|
||||
restic \
|
||||
-r /var/backups/$HOSTNAME \
|
||||
-p /var/backups/$HOSTNAME.secret \
|
||||
backup \
|
||||
--tag auto \
|
||||
--exclude-caches \
|
||||
--exclude dist \
|
||||
--exclude target \
|
||||
--exclude node_modules \
|
||||
--exclude bin \
|
||||
--exclude .cache \
|
||||
--exclude '.config/*/cache' \
|
||||
--exclude '.config/*/Cache' \
|
||||
--exclude .cargo/git \
|
||||
--exclude .cargo/registry \
|
||||
--exclude '.rustup' \
|
||||
--exclude '.local' \
|
||||
--exclude '.var' \
|
||||
--exclude Steam \
|
||||
--exclude '.config/Code' \
|
||||
--exclude '.config/Code - OSS' \
|
||||
--exclude 'code/linux' \
|
||||
--exclude Downloads \
|
||||
/srv /home /etc
|
||||
log backup finished with $?
|
10
crates/90-backups/scripts/setup.sh
Normal file
10
crates/90-backups/scripts/setup.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
|
||||
[ -d "/var/backups" ] || mkdir -p /var/backups
|
||||
[ -f "/var/backups/$HOSTNAME.secret" ] || openssl rand -hex 64 > /var/backups/$HOSTNAME.secret
|
||||
|
||||
restic init \
|
||||
-r /var/backups/$HOSTNAME \
|
||||
-p /var/backups/$HOSTNAME.secret
|
11
crates/90-backups/scripts/sync.sh
Normal file
11
crates/90-backups/scripts/sync.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# sync backup to *the* external
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
|
||||
set -e
|
||||
|
||||
rsync \
|
||||
--info=progress2 \
|
||||
-avzylu \
|
Loading…
Add table
Add a link
Reference in a new issue