backup-automation/full-backup.sh
ZoopaMario 52fee22f04
All checks were successful
Check Commit Messages / check-commit-message (pull_request) Successful in 13s
Lint Bash Scripts / lint-bash (pull_request) Successful in 23s
Lint Bash Scripts / lint-bash (push) Successful in 1m0s
Refactor code base focusing on extendability
- Add a library file containing common logic to be sourced by individual backup scripts
- Integrate logger file as it so far only contained a single method
- Make sure all relevant variables are defined within the related .env file
- Remove the option to pass command line  arguments to the script
2024-12-30 06:50:33 +01:00

20 lines
481 B
Bash
Executable file

#!/bin/bash
SCRIPT_ABS_LOCATION=$(realpath "$(dirname "${0}")")
# Define an array of application names
declare -a apps=("cryptpad" "immich" "duplicati" "nextcloud" "vaultwarden" "forgejo" "portainer")
# Function to execute the backup script for each application
backup_app() {
local app=$1
"$SCRIPT_ABS_LOCATION/$app/$app-backup.sh"
}
# Iterate over each app in the array and call the backup function
for app in "${apps[@]}"; do
backup_app "$app"
sleep 5
done