has some prune
This commit is contained in:
14
sync.sh
14
sync.sh
@@ -19,9 +19,10 @@ function main() {
|
|||||||
local action="$1"
|
local action="$1"
|
||||||
shift
|
shift
|
||||||
case "$action" in
|
case "$action" in
|
||||||
backup ) backup "$@" ;;
|
clean ) clean_remote --prune "$@" ;;
|
||||||
restore ) restore "$@" ;;
|
backup ) backup "$@" ;;
|
||||||
* ) RESTIC "$action" "$@" ;;
|
restore ) restore "$@" ;;
|
||||||
|
* ) RESTIC "$action" "$@" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,8 +86,8 @@ function backup() {
|
|||||||
-e "**.sw*" \
|
-e "**.sw*" \
|
||||||
--tag "${real#$HOME/}" \
|
--tag "${real#$HOME/}" \
|
||||||
$real
|
$real
|
||||||
RESTIC forget --keep-last 2 --group-by host,tags #--prune
|
|
||||||
done
|
done
|
||||||
|
clean_remote
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore() {
|
function restore() {
|
||||||
@@ -106,6 +107,11 @@ function restore() {
|
|||||||
mv $HOME/$path $HOME/$path-old
|
mv $HOME/$path $HOME/$path-old
|
||||||
mv $HOME/$path-restore $HOME/$path
|
mv $HOME/$path-restore $HOME/$path
|
||||||
done
|
done
|
||||||
|
clean_remote --prune
|
||||||
|
}
|
||||||
|
|
||||||
|
function clean_remote() {
|
||||||
|
RESTIC forget --keep-last 2 --group-by host,tags "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function RCLONE() {
|
function RCLONE() {
|
||||||
|
|||||||
Reference in New Issue
Block a user