feat: Updates backup script to only copy directories.
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
today=$(date +'%F')
|
||||
stackdir="/etc/komodo/stacks"
|
||||
backupdir="/backups"
|
||||
services=($(find "$stackdir" -maxdepth 1 -mindepth 1 -type d))
|
||||
|
||||
services=()
|
||||
readarray -d '' services < <(find "$stackdir" -maxdepth 1 -mindepth 1 -type d)
|
||||
|
||||
# Add volumes here to backup.
|
||||
volumes=(
|
||||
@@ -39,7 +41,14 @@ function copyVolumes() {
|
||||
local dir="$1/volumes"
|
||||
mkdir "$dir"
|
||||
for volume in "${volumes[@]}"; do
|
||||
cp -r --parents "$volume" "$dir"
|
||||
# copy only directories.
|
||||
#
|
||||
find "$volume" -maxdepth 1 -mindepth 1 -type d -print0 |
|
||||
xargs -0 -I {} cp -r --parents "$volume" "{}"
|
||||
|
||||
# for dir in $(find "$volume" -maxdepth 1 -mindepth 1 -type d); do
|
||||
# cp -r --parents "$volume" "$dir"
|
||||
# done
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user