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