Compare commits

...

5 Commits

Author SHA1 Message Date
15e70b7a58 Added Funding 2025-03-12 20:52:47 +01:00
35cdf1218d removed unecessary trigger 2025-03-12 11:14:40 +01:00
8cac183c17 changed rights 2024-02-05 21:06:38 +01:00
78ea7ba2ff changed script path 2024-02-05 21:02:56 +01:00
f0c235ac67 changed path 2024-02-05 21:00:26 +01:00
4 changed files with 13 additions and 7 deletions

7
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
github: kevinveenbirkenbach
patreon: kevinveenbirkenbach
buy_me_a_coffee: kevinveenbirkenbach
custom: https://s.veen.world/paypaldonate

View File

@@ -1,4 +1,6 @@
# Cleanup Failed Docker Backups # Cleanup Failed Docker Backups
[![GitHub Sponsors](https://img.shields.io/badge/Sponsor-GitHub%20Sponsors-blue?logo=github)](https://github.com/sponsors/kevinveenbirkenbach) [![Patreon](https://img.shields.io/badge/Support-Patreon-orange?logo=patreon)](https://www.patreon.com/c/kevinveenbirkenbach) [![Buy Me a Coffee](https://img.shields.io/badge/Buy%20me%20a%20Coffee-Funding-yellow?logo=buymeacoffee)](https://buymeacoffee.com/kevinveenbirkenbach) [![PayPal](https://img.shields.io/badge/Donate-PayPal-blue?logo=paypal)](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. 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
View File

@@ -1,13 +1,10 @@
#!/bin/bash #!/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 # Get the absolute path of the directory where the current script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Define the path to the original cleanup script using the script directory path # 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 # Path to the main directory
MAIN_DIRECTORY="/Backups" MAIN_DIRECTORY="/Backups"
@@ -29,7 +26,7 @@ for BACKUP_FOLDER_PATH in "$MAIN_DIRECTORY"/*; do
echo "Running cleanup script for folder: $BACKUP_FOLDER" echo "Running cleanup script for folder: $BACKUP_FOLDER"
# Call the cleanup script # Call the cleanup script
"$CLEANUP_SCRIPT" "$BACKUP_FOLDER" "$TRIGGER_DIR" "$CLEANUP_SCRIPT" "$BACKUP_FOLDER"
else else
echo "Directory $BACKUP_FOLDER_PATH/backup-docker-to-local not found." echo "Directory $BACKUP_FOLDER_PATH/backup-docker-to-local not found."
fi fi

4
cleanup.sh Normal file → Executable file
View File

@@ -18,9 +18,9 @@ for SUBDIR in "$MAIN_DIRECTORY"/*; do
# Only proceed if it is a directory # Only proceed if it is a directory
if [ -d "$SUBDIR" ]; then if [ -d "$SUBDIR" ]; then
echo "Validating directory: $SUBDIR" echo "Validating directory: $SUBDIR"
scripts_directory="$(dirname "$(dirname "$(realpath "$0")")")"
# Call the Python script for validation # 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=$? VALIDATION_STATUS=$?
if [ $VALIDATION_STATUS -eq 0 ]; then if [ $VALIDATION_STATUS -eq 0 ]; then