Add commands
This commit is contained in:
parent
2f990bb643
commit
a38b691403
@ -26,6 +26,10 @@ function time_diff {
|
|||||||
printf '%ds\n' $S
|
printf '%ds\n' $S
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function prune() {
|
||||||
|
test -z "$PRUNE_COMMAND" && return
|
||||||
|
./run_remote.sh cd "$DESTINATION_LOCATION" "&&" $PRUNE_COMMAND "$BORG_REPO"
|
||||||
|
}
|
||||||
function backup() {
|
function backup() {
|
||||||
# First, we need to rsync our changes to the host
|
# First, we need to rsync our changes to the host
|
||||||
echo "Running rsync..."
|
echo "Running rsync..."
|
||||||
@ -57,6 +61,9 @@ backup
|
|||||||
RESULT=$?
|
RESULT=$?
|
||||||
DURATION="$(time_diff "$(date +%s)" "$START_TIME" )"
|
DURATION="$(time_diff "$(date +%s)" "$START_TIME" )"
|
||||||
|
|
||||||
|
# Prune
|
||||||
|
prune
|
||||||
|
|
||||||
echo "Completed $(date +%F-%T)"
|
echo "Completed $(date +%F-%T)"
|
||||||
echo "Duration: $DURATION"
|
echo "Duration: $DURATION"
|
||||||
|
|
||||||
|
1
env.dist
1
env.dist
@ -5,3 +5,4 @@ REMOTE_HOST="user@example.com"
|
|||||||
DESTINATION_LOCATION="~/tmp/borg/$HOSTNAME/"
|
DESTINATION_LOCATION="~/tmp/borg/$HOSTNAME/"
|
||||||
BORG_COMMAND="borg create --verbose --progress --stats --one-file-system --exclude-caches --compression auto,lzma"
|
BORG_COMMAND="borg create --verbose --progress --stats --one-file-system --exclude-caches --compression auto,lzma"
|
||||||
BORG_REPO="runner2:borg/$HOSTNAME"
|
BORG_REPO="runner2:borg/$HOSTNAME"
|
||||||
|
# PRUNE_COMMAND="borg prune -v --list --keep-daily 7 --keep-weekly 4 --keep-monthly 2"
|
||||||
|
Loading…
Reference in New Issue
Block a user