3 #=======================================================================
5 # File ID: c31a44fa-001f-11e5-84cd-1fba44bd8d3d
7 # Unpack all gzip files in a directory tree and move them into one big
8 # .tar.gz file. For times when you for example realise you've got more
9 # than 39000 IRC logs since 2004. True story.
11 # Author: Øyvind A. Holm <sunny@sunbase.org>
12 # License: GNU General Public License version 2 or later.
13 #=======================================================================
27 " -n "$progname" -- "$@
")"
28 test "$?" = "0" ||
exit 1
36 -h|
--help) opt_help
=1; shift ;;
37 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
38 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
39 --version) echo $progname $VERSION; exit 0 ;;
41 *) echo $progname: Internal error
>&2; exit 1 ;;
44 opt_verbose
=$
(($opt_verbose - $opt_quiet))
46 if test "$opt_help" = "1"; then
47 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
50 Usage: $progname [options] DIRECTORY [DIRECTORIES [...]]
57 Be more quiet. Can be repeated to increase silence.
59 Increase level of verbosity. Can be repeated.
61 Print version information.
68 test -d "$dir" ||
{ echo $progname: $dir: Not a directory
>&2; continue; }
69 test -e "$dir.tar.gz" && { echo $progname: $dir.
tar.gz already exists
>&2; continue; }
70 label
=$
(suuid
-t c_
$progname -c "$progname: Pack $dir")
71 if test -z "$label"; then
72 echo $progname: Could not create UUID
for tar volume label
>&2
76 if test -n "$(git config --get annex.uuid)"; then
77 echo ========= ga edit
$dir
80 echo ========= gunzip
-r $dir
83 tar czf
"$dir.tar.gz" --label=$label --remove-files "$dir"