has some prune

master
Bel LaPointe 2019-06-25 09:32:18 -06:00
parent 1e7a7da7ac
commit 79c57d1ebe
1 changed files with 10 additions and 4 deletions

14
sync.sh
View File

@ -19,9 +19,10 @@ function main() {
local action="$1"
shift
case "$action" in
backup ) backup "$@" ;;
restore ) restore "$@" ;;
* ) RESTIC "$action" "$@" ;;
clean ) clean_remote --prune "$@" ;;
backup ) backup "$@" ;;
restore ) restore "$@" ;;
* ) RESTIC "$action" "$@" ;;
esac
}
@ -85,8 +86,8 @@ function backup() {
-e "**.sw*" \
--tag "${real#$HOME/}" \
$real
RESTIC forget --keep-last 2 --group-by host,tags #--prune
done
clean_remote
}
function restore() {
@ -106,6 +107,11 @@ function restore() {
mv $HOME/$path $HOME/$path-old
mv $HOME/$path-restore $HOME/$path
done
clean_remote --prune
}
function clean_remote() {
RESTIC forget --keep-last 2 --group-by host,tags "$@"
}
function RCLONE() {