-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjcompress.1
181 lines (181 loc) · 4.13 KB
/
jcompress.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
.TH JCOMPRESS "1" "December 2022" "[VERSION]" "User Commands"
.
.SH NAME
jcompress \- all-in-one compression script
.
.SH SYNOPSIS
jcompress [\fB-hMrVv\fR] [--longoption ...] [\fB-f\fR \fIFORMAT\fR] [--] \fIarchive\fR [\fIFILE|DIR\fR ...]
.
.SH DESCRIPTION
.I jcompress
is a script that wraps around several different archival programs.
Options passed to jcompress are translated to their corresponding options,
in the selected program.
Some options have custom implementations depending on the format used.
Such options are described below.
.
.SS "Supported formats"
\"List start
.TP
.B zip
Uses the
.B zip
program for archiving zip files.
Common and well know format.
Valid extension is zip.
.TP
.B 7z
Uses
.BR 7zr " or " 7za
depending on the options passed.
Boasts a greater compression ration than zip.
Valid extension is 7z.
.TP
.BR tar.gz / tgz
Uses
.B tar
with gzip compression.
Accepts the
.B --use-pigz
option.
This option requires pigz to be installed in order to work.
Valid extensions are: tar.gz, tgz.
.TP
.BR tar.bz2 / tbz2
Uses
.B tar
with bzip2 compression.
Accepts the
.B --use-pbzip2
option.
This option requires pbzip2 to be installed in order to work.
Valid extensions are: tar.bz2, tbz2.
.TP
.BR tar.7z / t7z
Uses
.B tar
with 7zip compression.
jcompress pipes the output of tar into \fB7za\fR, which then creates the 7z file.
All options available to 7z files are available here as well.
Valid extensions are: tar.7z, t7z.
\"List end
.
.SH OPTIONS
Arguments that are mandatory for short options are mandatory for long options as well.
.
.TP
.B -h
.TQ
.B --help
Display this help message and exit.
.
.TP
.B -V
.TQ
.B --version
Print the program version and exit.
.
.TP
.BI -f\~ format
.TQ
.B --format
Specifiy the format of the archive.
If this option is omitted, the archive's extension is used.
This option is required if
.I archive
has no extension or it is not a valid extension.
.
.TP
.B --use-pigz
Only available to tar.gz and tgz files.
Specifies
.B pigz
as the compression program to use.
In order for this option to work, pigz must be installed.
.
.TP
.B --use-pbzip2
Only available to tar.bz2 and tbz2 files.
Specifies
.B pbzip2
as the compression program to use.
In order for this option to work, pbzip2 must be installed.
.
.TP
.B --password
Encrypt the archive with a password.
What happens exactly will depend on the format.
See
.B PASSWORDS
below for details.
.
.TP
.B -r
.TQ
.B --recursive
Travel subdirectories recursively.
This option is ignored for some programs.
In \fB7z\fR, directory recursion is the default behavior, so this option is redundant.
Adding to that, the manual for \fB7z\fR says not to use its correspondant flag;
hence it is ignored.
Similarly, \fBtar\fR recurses directories by default,
so this option is ignored for all tar-derived formats.
.
.TP
.B -M
.TQ
.B --move
Move the files into the archive.
Actually, the files are simply deleted after copying them.
.B jcompress
implements this option for tar.7z files, since \fB-sdel\fR doesn't actually work in that instance.
.
.SH "EXIT STATUS"
.TP
.B 0
Successful program execution.
.TP
.B 1
Usage, syntax, or configuration error.
.TP
.B 2
Operational error.
.TP
.B 3
A child process returned a nonzero exit status.
.
.SH PASSWORDS
What
.B --password
does depends on the archive type.
Zip files have the
.B -e
option, which prompts for user input.
.B 7z
has the \fB-p\fR option, but it reads the password from the command line.
To circumvent this,
.B jcompress
has its own function to prompt the user for a password,
and their input is passed to this option as normal.
(tar.7z files follow the same protocol).
Tar-derived files (e.g., .tar.gz) are encrypted using
.BR gpg .
For
.B gpg
to work, the environment variable JC_GPGPUBKEY must be set to a public key.
For reference, the actual command used is:
.IP
gpg --encrypt --recipient $JC_GPGPUBKEY "$archive" && rm -v "$archive"
.
.PP
For reference, the command line to encrypt a 7z file with a password looks like this:
.IP
7z a -pPASSWORD archive.7z ...
.
.SH "ENVIRONMENT VARIABLES"
.IP JC_GPGPUBKEY
For formats that use gpg to encrypt the file, this
holds the public key to use.
.
.SH "SEE ALSO"
.BR 7z (1),\~ tar (1),\~ zip (1),\~ pigz (1),\~ pbzip2 (1),\~ gpg (1)