39 lines
958 B
Bash
39 lines
958 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# Define the source and destination paths
|
||
|
ORIGIN_HOST=socialservice-dev
|
||
|
ORIGIN_USER=alfredo.oliviero
|
||
|
|
||
|
DEST_FOLDER=remote_content
|
||
|
|
||
|
## add user to gcube group
|
||
|
# ssh $ORIGIN_USER@$ORIGIN_HOST "sudo usermod -a -G gcube $ORIGIN_USER"
|
||
|
|
||
|
ORIGIN_FOLDER=/home/gcube/tomcat
|
||
|
mkdir -p $DEST_FOLDER
|
||
|
|
||
|
# # Remove specific local directories before synchronization
|
||
|
# rm -fr $DEST_FOLDER/tomcat-7.0.62/temp
|
||
|
# rm -fr $DEST_FOLDER/tomcat-7.0.62/work
|
||
|
|
||
|
# Execute the rsync command
|
||
|
rsync -avz --delete \
|
||
|
--exclude='logs' \
|
||
|
--exclude='temp' \
|
||
|
--exclude='tmp' \
|
||
|
--exclude='work' \
|
||
|
--exclude='common' \
|
||
|
--exclude='server' \
|
||
|
--exclude='shared' \
|
||
|
$ORIGIN_USER@$ORIGIN_HOST:$ORIGIN_FOLDER $DEST_FOLDER
|
||
|
|
||
|
ORIGIN_FOLDER=/home/gcube/SmartGears
|
||
|
mkdir -p $DEST_FOLDER
|
||
|
|
||
|
# Execute the rsync command
|
||
|
rsync -avz --delete \
|
||
|
--exclude='lib' \
|
||
|
--exclude='apps' \
|
||
|
--exclude='*.log' \
|
||
|
$ORIGIN_USER@$ORIGIN_HOST:$ORIGIN_FOLDER $DEST_FOLDER
|