Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
geocat-ancillary
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geocat
geocat-ancillary
Commits
517e07e6
Commit
517e07e6
authored
7 years ago
by
Nick Bearson
Browse files
Options
Downloads
Patches
Plain Diff
adding an initial version of the sync script
parent
259f3d5c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/sync.sh
+31
-0
31 additions, 0 deletions
scripts/sync.sh
with
31 additions
and
0 deletions
scripts/sync.sh
0 → 100755
+
31
−
0
View file @
517e07e6
#!/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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment