adding bash script to copy configs to bound folders
This commit is contained in:
21
scripts/copy.sh
Normal file
21
scripts/copy.sh
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Set the source and destination directories
|
||||||
|
source_dir=/app
|
||||||
|
destination_dir=/config
|
||||||
|
|
||||||
|
# Get a list of files in the source directory
|
||||||
|
files=$(ls "$source_dir")
|
||||||
|
|
||||||
|
# Loop through the list of files
|
||||||
|
for file in $files
|
||||||
|
do
|
||||||
|
# Check if the file exists in the destination directory
|
||||||
|
if [ ! -f "$destination_dir/$file" ]; then
|
||||||
|
# If the file does not exist, copy it to the destination directory
|
||||||
|
cp "$source_dir/$file" "$destination_dir/$file"
|
||||||
|
echo "Copied $file to $destination_dir"
|
||||||
|
else
|
||||||
|
echo "$file already exists in $destination_dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user