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 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
|
*** Begin of README file, Version 1.0.7 ***
"truc & untruc" scripts allow you to send and receive big files or
directories using e-mail.
Copyright 1994-1998 - David Segonds
Version 1.0.7, last modification: 15 Oct 98
Contact: segonds@ensg.u-nancy.fr
URL: http://www.ensg.u-nancy.fr/~segonds/truc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.0 Introduction
================
The main components of this package are "truc" and "untruc", two Bourne shell
script files. They allow you to transfer big files or directories without
hassle through e-mail. Files are split in small e-mail messages before
transmission and automatically rebuild upon reception.
truc encapsulates the tar, gzip (or compress), uuencode, split, mail unix
commands to send big files through e-mail. untruc uses csplit, cat, uudecode,
gunzip, tar to restore the original file at the other end.
Upon reception the messages need to be concatenated in one big file which is
auto-extractible.
These scripts have been tested under Linux, IRIX, Solaris and HP-UX, please
send me an e-mail if you have tested them on an another platform or if it
failed for one of the Unix I have cited here. I am also interested in patches
and suggestions. This scripts will _never_ work for MS-DOG or Window$.
I was unable to find scripts able to transfer large binaries files through
e-mail without having to worry about tar, uuencoding and so on, so I have
created truc and untruc. I'm sure the scripts are not perfect but they already
have help me a lot...
These scripts have been written in /bin/sh to be able to run without
compilation on as many unix machines as possible.
Note: I didn't use Perl because this tool is not part of all the Unix standard
distributions.
2.0 Install
===========
Just copy truc & untruc in a directory in your $PATH.
3.0 How to send files through e-mail
====================================
Let's say you have a file called 'toto' you want to send to your friend
john@paradise.com, you just need to type:
truc john@paradise.com toto
truc will automatically compress, uuencode, split in chunks of 90 Kb
and send the file "toto" to john@paradise.com.
When John will receive its messages, he will save them in a <file>. By
typing 'sh <file>' or 'untruc <file>' (if he has it), the file toto will be
restored.
4.0 Truc options
================
usage: truc [-h] [-t val] [-l val] [[-p ext]...] [-report] [-r e-mail] [-m]
[-n] [-v] [-d] [-q] [-z] [-bz] [-bz2] [-x] e-mail[,...] <file|dir>
truc has the following options:
-h : Get this help
-t val : Sleep val seconds between each packet sent (default=30)
-l val : value is the maximum number of lines for a packet
(default 1500 lines, this is about 90 Kb per packet)
-k val : value is the maximum size of a packet in Kb (default 90 Kb)
-p val : Will mail only the specified packet (1, 2, 3, etc.)
you can have more than one -p option in the command line.
Warning: This option is not working when sending directories.
-report : Will mail a report (default=no report mailed)
-r e-mail : Will mail a receipt to e-mail upon 'untruc' completion.
-m : Will prompt the user for a mail to be sent with the packages
-n : Seems to do all the job BUT doesn't send anything
-v : Turn on verbose mode
-d : Turn on debug mode
-q : Send will be totally quiet (no message displayed)
-z : Force the use of compress instead of gzip
-bz : Force the use of bzip as compressor
-bz2 : Force the use of bzip2 as compressor
-x : Upon reception, contents will be extracted as far as possible.
e-mail : E-mail address were you want to mail your file or directory.
You can provide more than one address if you separate then
by a comma
file|dir : Name of the file or directory you want to send
In function of the type of file or the extension in its name, only some
operations will be performed during the truc operation:
+-----------+-----+---------------+----------+
| | tar | compress | uuencode |
+-----------+-----+---------------+----------+
| directory | X | X | X |
| .* | X | X | X |
| .tar | | X | X |
| .gz | | | X |
| .bz | | | X |
| .bz2 | | | X |
| .taz | | | X |
| .tgz | | | X |
| .Z | | | X |
| .cr | | | X |
| .crypt | | | X |
| .uu | | | |
+-----------+-----+---------------+----------+
truc is looking for 'gzip' command and if not found, it will use the 'compress'
command instead. The -z flag will force the use of compress even if gzip is
present.
You can put your favorite options in $HOME/.trucrc, for example, my
$HOME/.trucrc contains the following line: '-v -k 1000 -t 2'. Only the first
line of $HOME/.trucrc is interpreted when starting truc. These default options
are overidden by command line options.
5.0 untruc options
==================
usage: untruc [-h] [-x] [-v] [-d] [-q] [-r {yes|no} ] filename [filename2 ...]
untruc have the following options:
-h : Get this help
-x : To extract as far as possible the content of the received file
(i.e., .gz will be gunzipped, .tar untarred, etc.)
-v : Verbose
-d : Debug (Will print some debug message)
-q : untruc will be totally quiet (no output message)
-r yes : If sender ask for a receipt, it will be automatically sent.
-r no : No receipt will be sent in any case.
filename : Files to process (at least one)
When getting all the chunks in your mailbox, you just have to save them in one
or many files and then 'apply' /bin/sh on these files. When saving messages
ordering is unsignificant. You don't have to call untruc directly but you can
use it instead of /bin/sh.
The number of chunks you can save in each file is limited to 99. If your
transfer is chopped in more than 99 chunks, save them in more than one file.
This limitation is due to the csplit command. GNU csplit have an option go
around this problem but not everybody is using GNU csplit. :-)
The -x option allow to extract the received file. For example if you receive a
.tar.gz file, untruc will 'gunzip' and 'untar' it.
-x use the filename extension to work. You will find below the commands used
for each type of files:
*.gz : gzip -d
*.bz : bzip -d
*.bz2 : bzip2 -d
*.Z : uncompress
*.cr *.crypt : crypt
*.pgp : pgp
*.tar : tar xf
untruc can also be used on normal uuencoded files. That's nice when you want to
extract in one go a .tar.gz.uu file (see option -x).
You can put your favorite options in $HOME/.untrucrc, for example, my
$HOME/.untrucrc contains the following line: '-d -r yes'. Only the first line
of $HOME/untrucrc is interpreted when starting untruc. These default options
are overidden by command line options if any.
6.0 Contact
===========
If you have some problems in using truc or untruc you can send me an e-mail
(segonds@ensg.u-nancy.fr).
I would also like to receive some bug reports.
If you think that some improvements can be made, once again, you just have to
tell me. That's how these scripts are slowly evolving.
Last version of truc and untruc can be found at the following URL:
http://www.ensg.u-nancy.fr/~segonds/truc
7.0 Acknowledgements
====================
I would like to thank Jol, Fabien, Pierre and Philippe who have helped me to
improve and debug the truc and untruc scripts (or their ancestors the send and
receive scripts). Many thanks to Nat who is never statisfied and help me to
improve this product a lot. :-)
Thanks also to Thomas Bullinger who send bug reports for truc on Solaris.
8.0 Known bugs and limitations
==============================
If you don't use gzip, truc will use compress but if the compressed file is
larger then the original, compress will return a 2 error code and truc will
fail.
For untruc, there is apparently a limitation in the number of packets you can
save in each file (up to 99). If your transfer uses more than 99 chunks, save
them in more than one file. This limitation is due to the csplit command.
Problem solved by GNU csplit but not everybody is using it.
9.0 Conclusion
==============
I hope you will enjoy using these scripts. They are probably not perfect (such
as my English) but they can be useful sometimes.
By the way, truc means "Transfert Rapide Uuencod Compress" in French.
*** End of README file, Version 1.0.7 ***
|