has some prune
This commit is contained in:
8
sync.sh
8
sync.sh
@@ -19,6 +19,7 @@ function main() {
|
||||
local action="$1"
|
||||
shift
|
||||
case "$action" in
|
||||
clean ) clean_remote --prune "$@" ;;
|
||||
backup ) backup "$@" ;;
|
||||
restore ) restore "$@" ;;
|
||||
* ) RESTIC "$action" "$@" ;;
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user