3 #=======================================================================
5 # File ID: 8af4d956-f358-11e4-b717-000df06acc56
7 # Get new files from the last month (can be overridden) that haven't got
8 # enough copies in git-annex yet, then optionally execute a fast fsck to
9 # check that the files have enough copies.
11 # Author: Øyvind A. Holm <sunny@sunbase.org>
12 # License: GNU General Public License version 2 or later.
13 #=======================================================================
31 " -n "$progname" -- "$@
")"
32 test "$?" = "0" ||
exit 1
43 --from) opt_from
="$2"; shift 2 ;;
44 --fsck) opt_fsck
=1; shift ;;
45 -h|
--help) opt_help
=1; shift ;;
46 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
47 -r|
--resume) opt_resume
=1; shift ;;
48 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
49 --version) echo $progname $VERSION; exit 0 ;;
51 *) echo $progname: Internal error
>&2; exit 1 ;;
54 opt_verbose
=$
(($opt_verbose - $opt_quiet))
56 if test "$opt_help" = "1"; then
57 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
60 Get new files from the last month (can be overridden) that haven't got
61 enough copies in git-annex yet, then optionally execute a fast fsck to
62 check that the files have enough copies.
64 Arguments and options after " -- " are delivered to git-allfiles(1)
65 which delivers them further to "git log".
67 Usage: $progname [options] [ -- options_to_git-allfiles ]
72 Get new files from Git remote REMOTE.
74 Execute "ga fsck" after the files are copied.
78 Be more quiet. Can be repeated to increase silence.
80 Don't execute an initial "ga sync", resume an earlier interrupted
83 Increase level of verbosity. Can be repeated.
85 Print version information.
93 echo ==== $progname: $
*
96 toplevel
="$(git rev-parse --show-toplevel)"
98 echo $progname: $toplevel: Cannot chdir to top of repo
>&2
102 if test "$opt_resume" != "1"; then
103 # Using backslash before { and } to suppress folding when editing this
107 echo $progname: ga sync \
}\
}\
}
110 if test -n "$opt_from"; then
111 from_str
=" --from=$opt_from"
116 msg git allfiles
--since=1.month $
*
117 msg ga get
--auto$from_str
118 git allfiles
--since=1.month
"$@" |
120 xargs -d \\n
--no-run-if-empty ga get
--auto$from_str
122 if test "$opt_fsck" = "1"; then
123 msg ga fsck
--fast --quiet
124 git allfiles
--since=1.month
"$@" |
126 xargs -d \\n
--no-run-if-empty ga fsck
--fast --quiet
131 echo $progname: ga sync \
}\
}\
}