~jheckt/GoofyStuff

3a7f697a7fe85cdd5283a19ee807546a2bb59e59 — jheckt 1 year, 11 days ago 8c35edc main
script for mirrors repos on my NAS
1 files changed, 25 insertions(+), 0 deletions(-)

A archiving/mirror_repos.sh
A archiving/mirror_repos.sh => archiving/mirror_repos.sh +25 -0
@@ 0,0 1,25 @@
#!/bin/bash
#

dt=$(date)
echo "Starting repo mirroring at $dt"

TARGET_DIR=$1

cd $TARGET_DIR

# For each subdirectory in the target directory, pull from the remote repository
for dir in $(ls -d */); do
	cd $dir
	git pull > /dev/null 2>&1

	if [ $? -ne 0 ]; then
		echo "Error pulling $dir"
	else
		echo "Pulled $dir"
	fi

	cd ..
done