add a home backup script
This commit is contained in:
7
bin/backup-home.sh
Normal file
7
bin/backup-home.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Tar my dotfiles and configs to the NAS. Excludes anything gitignored-looking.
|
||||||
|
set -eu
|
||||||
|
dest="/mnt/nas/backup/$(hostname)-$(date +%F).tgz"
|
||||||
|
tar --exclude='*.env' --exclude='*.pem' --exclude='*.p12' \
|
||||||
|
-czf "$dest" "$HOME/.config" "$HOME/dotfiles" 2>/dev/null || true
|
||||||
|
echo "wrote $dest"
|
||||||
Reference in New Issue
Block a user