_dump/bak-current_to_archive.sh

88 lines
1.5 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_home"
cd `realpath "$0" | xargs dirname`
./bak-home.sh "$BAK/Home_deb"
sudo \
rsync -zrhP --links --size-only --verbose --delete \
--exclude '**/.Trash-1000' \
--exclude '**/__sapper__/' \
--exclude '**/node_modules/' \
--exclude '**/target/' \
"/Servers/self/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
Code
Img
Music
Ui
Forks
Fonts
Templates
Work
)
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/$DIR/" \
"$BAK/${DIR}"
done
DIRS=(
Apps
Cfg
)
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
sudo \
rsync -zrhP --links --size-only --verbose --delete \
"/var/lib/docker/" \
"$BAK/var_lib_docker"