Новый скрипт - синхронизация репозиториев

new file:   repo_sync.sh
This commit is contained in:
2026-07-17 12:45:53 +03:00
parent 2ab22e692e
commit 48ea40f550
+17
View File
@@ -0,0 +1,17 @@
#!/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