#!/bin/bash source=/datas/git destination=/datas/git.ccyr.eu echo "check diff from ${source} to ${destination}" [ -e /tmp/rsync_push.log ] && rm /tmp/rsync_push.log rsync -anpz --delete-after --exclude=*.git* --out-format="%B %l %M %f" ${source}/ ${destination} |tee /tmp/rsync_push.log [ -s /tmp/rsync_push.log ] && echo "to push to distant, copy following command : \ rsync -apvz --delete-after --exclude=*.git* --out-format=\"%B %l %M %f\" ${source}/ ${destination}" commit_repository() { echo "check repository $1" cd ${destination}/$1 git status } for repository in ansible computers financial genealogie do commit_repository ${repository} done