initial commit

This commit is contained in:
John Lancaster
2024-05-20 18:45:02 -05:00
commit 330ae34cc0
4 changed files with 68 additions and 0 deletions

25
restic_backup.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
SCRIPT_DIR=$(readlink -f $(dirname "${BASH_SOURCE[0]}"))
COMPOSE_FILE=$SCRIPT_DIR/docker-compose.yml
SERVICES="server db"
echo -n "Stopping containers..."
docker compose -f $COMPOSE_FILE stop $SERVICES 2>/dev/null
echo "Done"
echo -n "Running backup..."
$SCRIPT_DIR/restic_command.sh backup /data "$@"
echo "Done"
echo -n "Executing compose up..."
docker compose -f $COMPOSE_FILE up -d 2>/dev/null
echo "Done"
echo -n "Pruning restic repo..."
$SCRIPT_DIR/restic_prune.sh 1>/dev/null
echo "Done"
SPACE=$(du -hs /mnt/* | awk '{print $1}')
echo "Total space used: $SPACE"