mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup-cleanup.git
synced 2025-09-10 20:27:13 +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
|
# 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.
|
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
|
#!/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
4
cleanup.sh
Normal file → Executable 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
|
||||||
|
Reference in New Issue
Block a user