- Le immagini uploadate non vengono visualizzate subito... cache... aggiungere la versione dell'immagine: vers_img
- Aggiunto il Server TESTRISO e TEST_PCB.
This commit is contained in:
30
scripts/docker_copia_da_a.sh
Normal file
30
scripts/docker_copia_da_a.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure two arguments are provided
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "Usage: $0 <source_directory> <destination_directory>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIR_ORIG=$1
|
||||
DIR_DEST=$2
|
||||
|
||||
# Check if the source directory exists
|
||||
if [ ! -d "$DIR_ORIG" ]; then
|
||||
echo "Error: Source directory '$DIR_ORIG' does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the destination directory if it doesn't exist
|
||||
#mkdir -p "$DIR_DEST"
|
||||
|
||||
# Run the Docker command to copy files
|
||||
docker run --rm -v "$DIR_ORIG":/from -v "$DIR_DEST":/to alpine ash -c "cp -av /from/. /to"
|
||||
|
||||
# Check if the Docker command was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Files copied successfully from '$DIR_ORIG' to '$DIR_DEST'."
|
||||
else
|
||||
echo "Error: Failed to copy files."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user