Commit cd38b93c authored by Miloš Diviš's avatar Miloš Diviš
Browse files

test version with verbose dry-run separated

parent e75a5f06
......@@ -16,12 +16,12 @@ cd $current_dir
# set maintenance mode
echo '* setting maintenance mode on remote app'
rsync -v --dry-run \
rsync \
"$server:$remote_dir/www/index.php temp/"
sed -i "s/\/\/\s*require '.maintenance.php';/require '.maintenance.php';/" index.php
rsync -v --dry-run \
rsync \
"temp/index.php $server:$remote_dir/www/"
rm temp/index.php
......@@ -37,18 +37,17 @@ done
echo '* Starting rsync to $server:$target_dir/test/'
rsync -v --dry-run \
rsync \
-r --delete \
--filter "P log/*.log" --filter "P log/*.html" \
--include ".htaccess" --exclude-from exclude.txt \
"." "moved/"
# . "$server:$target_dir/test/"
. "$server:$target_dir"
rm exclude.txt
echo '* files uploaded. Sending index.php'
rsync -v --dry-run \
rsync \
www/index.php "$server:$remote_dir/www/"
echo '* maintance mode off. files uploaded'
......
# /bin/bash
# setup
server='aaaa'
remote_dir='/www/'
rsync_exclude=('/www/images/uploads/*')
# index.php excluded and send last because of maintenance mode
common_exclude=('*.ssh' '/temp/*' '/log/*' '/nbproject' '/.git' '.gitignore' 'composer.json' '/www/index.php')
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $current_dir
# set maintenance mode
echo '* setting maintenance mode on remote app'
rsync -v --dry-run \
"$server:$remote_dir/www/index.php temp/"
sed -i "s/\/\/\s*require '.maintenance.php';/require '.maintenance.php';/" index.php
rsync -v --dry-run \
"temp/index.php $server:$remote_dir/www/"
rm temp/index.php
# create exclude text file
for i in "${rsync_exclude[@]}"
do
echo $i >> exclude.txt
done
for i in "${common_exclude[@]}"
do
echo $i >> exclude.txt
done
echo '* Starting rsync to $server:$target_dir/test/'
rsync -v --dry-run \
-r --delete \
--filter "P log/*.log" --filter "P log/*.html" \
--include ".htaccess" --exclude-from exclude.txt \
"." "moved/"
# . "$server:$target_dir/test/"
rm exclude.txt
echo '* files uploaded. Sending index.php'
rsync -v --dry-run \
www/index.php "$server:$remote_dir/www/"
echo '* maintance mode off. files uploaded'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment