feat: Updates backup script to only copy directories.
This commit is contained in:
@@ -3,7 +3,9 @@
|
|||||||
today=$(date +'%F')
|
today=$(date +'%F')
|
||||||
stackdir="/etc/komodo/stacks"
|
stackdir="/etc/komodo/stacks"
|
||||||
backupdir="/backups"
|
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.
|
# Add volumes here to backup.
|
||||||
volumes=(
|
volumes=(
|
||||||
@@ -39,7 +41,14 @@ function copyVolumes() {
|
|||||||
local dir="$1/volumes"
|
local dir="$1/volumes"
|
||||||
mkdir "$dir"
|
mkdir "$dir"
|
||||||
for volume in "${volumes[@]}"; do
|
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
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user