Skip to content
Snippets Groups Projects
Commit 517e07e6 authored by Nick Bearson's avatar Nick Bearson
Browse files

adding an initial version of the sync script

parent 259f3d5c
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
REMOTE="vaa2:/data/common/GEOCAT_ANCILLARY_DATA/"
LOCAL="data/"
if [ ! -d ${LOCAL} ]; then
echo "${LOCAL} not found. This script expects to be run from the geocat-ancillary/ directory."
exit 1
fi
list_updated_files() {
rsync --dry-run --copy-links -rcv ${REMOTE} ${LOCAL} | \
grep -v "receiving" | \
grep -v "bytes/sec" | \
grep -v "DRY RUN"
}
echo "Retrieving a list of updated & new files from:"
echo "${REMOTE}"
echo "Get a ☕ , this could take a bit..."
for file in $(list_updated_files); do
echo ""
echo "${file} is updated or new. Download?"
select yn in "Yes" "No"; do
case ${yn} in
Yes ) rsync --progress --copy-links ${REMOTE}${file} ${LOCAL}${file}; break;;
No ) break;;
esac
done
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment