17 lines
540 B
Bash
17 lines
540 B
Bash
#!/bin/bash
|
|
repo=repo-wh01.gk.rosatom.local
|
|
repo_path='/var/www/repo/'
|
|
sync_dirs=( 'astra/1.7.9/' 'astra/1.7/' 'SN/' 'avz/' 'astra/1.7.10/' 'astra/1.8.5/' )
|
|
|
|
for sync_dir in ${sync_dirs[@]}; do
|
|
[ ! -d ${repo_path}${sync_dir} ] && mkdir -p ${repo_path}${sync_dir}
|
|
rsync -avz --delete --bwlimit=1000 --info=progress2 "$repo::repo/${sync_dir}" "${repo_path}${sync_dir}"
|
|
done
|
|
|
|
if [ $? -ne 0 ]; then
|
|
echo "Access denied, check $repo"
|
|
exit 1
|
|
fi
|
|
|
|
chown www-data:www-data -R /var/www/repo
|
|
chmod 755 -R /var/www/repo |