mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup-cleanup.git
synced 2025-09-10 04:09:00 +02:00
Compare commits
5 Commits
62d69bac03
...
main
Author | SHA1 | Date | |
---|---|---|---|
15e70b7a58 | |||
35cdf1218d | |||
8cac183c17 | |||
78ea7ba2ff | |||
f0c235ac67 |
7
.github/FUNDING.yml
vendored
Normal file
7
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
github: kevinveenbirkenbach
|
||||
|
||||
patreon: kevinveenbirkenbach
|
||||
|
||||
buy_me_a_coffee: kevinveenbirkenbach
|
||||
|
||||
custom: https://s.veen.world/paypaldonate
|
@@ -1,4 +1,6 @@
|
||||
# Cleanup Failed Docker Backups
|
||||
[](https://github.com/sponsors/kevinveenbirkenbach) [](https://www.patreon.com/c/kevinveenbirkenbach) [](https://buymeacoffee.com/kevinveenbirkenbach) [](https://s.veen.world/paypaldonate)
|
||||
|
||||
|
||||
This repository hosts a Bash script designed for cleaning up directories within the Docker Volume Backup system. It is intended to be used in conjunction with the [Docker Volume Backup](https://github.com/kevinveenbirkenbach/docker-volume-backup) project.
|
||||
|
||||
|
7
cleanup-all.sh
Normal file → Executable file
7
cleanup-all.sh
Normal file → Executable file
@@ -1,13 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define trigger directory argument as TRIGGER_DIR
|
||||
TRIGGER_DIR="$2"
|
||||
|
||||
# Get the absolute path of the directory where the current script is located
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
# Define the path to the original cleanup script using the script directory path
|
||||
CLEANUP_SCRIPT="$SCRIPT_DIR/cleanup_script.sh"
|
||||
CLEANUP_SCRIPT="$SCRIPT_DIR/cleanup.sh"
|
||||
|
||||
# Path to the main directory
|
||||
MAIN_DIRECTORY="/Backups"
|
||||
@@ -29,7 +26,7 @@ for BACKUP_FOLDER_PATH in "$MAIN_DIRECTORY"/*; do
|
||||
echo "Running cleanup script for folder: $BACKUP_FOLDER"
|
||||
|
||||
# Call the cleanup script
|
||||
"$CLEANUP_SCRIPT" "$BACKUP_FOLDER" "$TRIGGER_DIR"
|
||||
"$CLEANUP_SCRIPT" "$BACKUP_FOLDER"
|
||||
else
|
||||
echo "Directory $BACKUP_FOLDER_PATH/backup-docker-to-local not found."
|
||||
fi
|
||||
|
4
cleanup.sh
Normal file → Executable file
4
cleanup.sh
Normal file → Executable file
@@ -18,9 +18,9 @@ for SUBDIR in "$MAIN_DIRECTORY"/*; do
|
||||
# Only proceed if it is a directory
|
||||
if [ -d "$SUBDIR" ]; then
|
||||
echo "Validating directory: $SUBDIR"
|
||||
|
||||
scripts_directory="$(dirname "$(dirname "$(realpath "$0")")")"
|
||||
# Call the Python script for validation
|
||||
python ../directory-validator/directory-validator.py "$SUBDIR" --validate
|
||||
python $scripts_directory/directory-validator/directory-validator.py "$SUBDIR" --validate
|
||||
VALIDATION_STATUS=$?
|
||||
|
||||
if [ $VALIDATION_STATUS -eq 0 ]; then
|
||||
|
Reference in New Issue
Block a user