_dump/bak-current_to_archive.sh

90 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env zsh
BAK="/Data/_bak"
# restic init '/home/dym/.privat' \
# -p '/home/dym/.privat/restic/p.txt' \
# -r "$BAK/.privat"
restic backup '/home/dym/.privat' \
-p '/home/dym/.privat/restic/p.txt' \
-r "$BAK/.privat"
# cd `realpath "$0" | xargs dirname`
# ./bak-home "$BAK/Home_nix"
sudo \
rsync -zrhP --links --size-only --verbose --delete \
--exclude '**/.Trash-1000' \
--exclude '**/__sapper__/' \
--exclude '**/node_modules/' \
--exclude '**/target/' \
"/Servers/self-files/My/" \
"/Data/_my"
# sudo \
# rsync -zrhP --links --size-only --verbose --delete \
# --exclude '**/.Trash-1000' \
# --exclude '**/__sapper__/' \
# --exclude '**/node_modules/' \
# --exclude '**/target/' \
# "/Work/" \
# "$BAK/work-CURRENT"
DIRS=(
Books
Cfg_nix
Code
Img
Music
Ui
)
for DIR in "${DIRS[@]}"; do
echo "-
-
# '$DIR'"
sudo \
rsync -zrhP --links --size-only --verbose --delete \
--exclude '**/.Trash-1000' \
--exclude '**/__sapper__/' \
--exclude '**/node_modules/' \
--exclude '**/target/' \
"/Servers/self-files/$DIR/" \
"$BAK/${DIR}"
done
DIRS=(
Apps
)
for DIR in "${DIRS[@]}"; do
echo "-
-
# '$DIR'"
sudo \
rsync -zrhP --links --size-only --verbose --delete \
--exclude '**/.Trash-1000' \
--exclude '**/__sapper__/' \
--exclude '**/node_modules/' \
--exclude '**/target/' \
"/$DIR/" \
"$BAK/${DIR}"
done
echo "-
-
# '.fonts'"
sudo \
rsync -zrhP --links --size-only --verbose --delete \
--exclude '**/.Trash-1000' \
--exclude '**/__sapper__/' \
--exclude '**/node_modules/' \
--exclude '**/target/' \
"/home/dym/.fonts/" \
"$BAK/Fonts"