1SZ(1)                       General Commands Manual                      SZ(1)
2
3
4

NAME

6       sx, sb, sz - XMODEM, YMODEM, ZMODEM file send
7

SYNOPSIS

9       sz [-+8abdefkLlNnopqTtuvyY] file ...
10       sb [-adfkqtuv] file ...
11       sx [-akqtuv] file
12       sz [-oqtv] -c COMMAND
13       sz [-oqtv] -i COMMAND
14       sz -TT
15

DESCRIPTION

17       Sz  uses the ZMODEM, YMODEM or XMODEM error correcting protocol to send
18       one or more files over a dial-in serial port to a variety  of  programs
19       running under PC-DOS, CP/M, Unix, VMS, and other operating systems.
20
21       While  rz is smart enough to be called from cu(1), very few versions of
22       cu(1) are smart enough to allow sz to work properly.  Unix  flavors  of
23       Professional-YAM are available for such dial-out application.
24
25
26       Sz sends one or more files with ZMODEM protocol.
27
28       ZMODEM  greatly simplifies file transfers compared to XMODEM.  In addi‐
29       tion to a friendly user interface, ZMODEM  provides  Personal  Computer
30       and  other  users  an  efficient,  accurate,  and  robust file transfer
31       method.
32
33       ZMODEM provides complete END-TO-END data integrity between  application
34       programs.   ZMODEM's 32 bit CRC catches errors that sneak into even the
35       most advanced networks.
36
37       Advanced file management features include AutoDownload (Automatic  file
38       Download  initiated  without  user intervention), Display of individual
39       and total file lengths and transmission time estimates, Crash Recovery,
40       selective  file  transfers,  and  preservation  of  exact file date and
41       length.
42
43       Output from another program may be piped  to  sz  for  transmission  by
44       denoting standard input with "-":
45                                    ls -l | sz -
46       The  program  output is transmitted with the filename sPID.sz where PID
47       is the process ID of the sz program.  If the environment variable ONAME
48       is set, that is used instead.  In this case, the Unix command:
49                             ls -l | ONAME=con sz -ay -
50       will  send  a  "file"  to  the  PC-DOS  console display.  The -y option
51       instructs the receiver to open the file  for  writing  unconditionally.
52       The  -a  option  causes the receiver to convert Unix newlines to PC-DOS
53       carriage returns and linefeeds.
54
55
56       Sb batch sends one or more files with YMODEM or ZMODEM  protocol.   The
57       initial  ZMODEM  initialization  is  not  sent.   When requested by the
58       receiver, sb supports YMODEM-g with "cbreak" tty  mode,  XON/XOFF  flow
59       control,  and  interrupt  character set to CAN (^X).  YMODEM-g (Profes‐
60       sional-YAM g option) increases  throughput  over  error  free  channels
61       (direct  connection, X.PC, etc.)  by not acknowledging each transmitted
62       sector.
63
64       On Unix systems, additional information about the file is  transmitted.
65       If  the  receiving  program uses this information, the transmitted file
66       length controls the  exact  number  of  bytes  written  to  the  output
67       dataset, and the modify time and file mode are set accordingly.
68
69
70       Sx  sends  a  single  file with XMODEM or XMODEM-1k protocol (sometimes
71       incorrectly called "ymodem").  The user must supply the  file  name  to
72       both sending and receiving programs.
73
74       If  sz  is  invoked  with  $SHELL set and if that variable contains the
75       string  rsh  ,  rbash  or  rksh  (restricted  shell),  sz  operates  in
76       restricted  mode.   Restricted  mode restricts pathnames to the current
77       directory and PUBDIR (usually /usr/spool/uucppublic) and/or subdirecto‐
78       ries thereof.
79
80
81       The  fourth form sends a single COMMAND to a ZMODEM receiver for execu‐
82       tion.  Sz exits with the COMMAND return  value.   If  COMMAND  includes
83       spaces or characters special to the shell, it must be quoted.
84
85
86       The  fifth  form sends a single COMMAND to a ZMODEM receiver for execu‐
87       tion.  Sz exits as soon as the receiver has correctly received the com‐
88       mand, before it is executed.
89
90
91       The sixth form (sz -TT) attempts to output all 256 code combinations to
92       the terminal.  In you are having difficulty sending files, this command
93       lets  you  see  which  character codes are being eaten by the operating
94       system.
95
96
97       If sz is invoked with stdout and stderr to different datasets,  Verbose
98       is  set  to 2, causing frame by frame progress reports to stderr.  This
99       may be disabled with the q option.
100
101       The meanings of the available options are:
102
103       -+, --append
104              Instruct the receiver to append transmitted data to an  existing
105              file (ZMODEM only).
106       -2, --twostop
107              use two stop bits (if possible). Do not use this unless you know
108              what you are doing.
109       -8, --try-8k
110              Try to go up to 8KB blocksize. This is incompatible  with  stan‐
111              dard  zmodem,  but  a common extension in the bbs world. (ZMODEM
112              only).
113       --start-8k
114              Start with 8KB blocksize. Like --try-8k.
115       -a, --ascii
116              Convert NL characters in the transmitted file to CR/LF.  This is
117              done  by  the  sender for XMODEM and YMODEM, by the receiver for
118              ZMODEM.
119       -b, --binary
120              (ZMODEM) Binary override: transfer file without any translation.
121       -B NUMBER, --bufsize NUMBER
122              Use a readbuffer of NUMBER bytes. Default is 16384, which should
123              be  enough  for most situations. If you have a slow machine or a
124              bad disk interface or suffer from other  hardware  problems  you
125              might  want to increase the buffersize.  -1 or auto use a buffer
126              large enough to buffer the whole  file.  Be  careful  with  this
127              option  -  things normally get worse, not better, if the machine
128              starts to swap.
129
130              Using this option turns of memory mapping  of  the  input  file.
131              This increases memory and CPU usage.
132       -c COMMAND, --command COMMAND
133              Send  COMMAND  to  the  receiver for execution, return with COM‐
134              MAND´s exit status.
135       -C N, --command-tries N
136              Retry to send command N times (default: 11).
137       -d, --dot-to-slash
138              Change all instances of "." to "/" in the transmitted  pathname.
139              Thus,  C.omenB0000  (which  is unacceptable to MSDOS or CP/M) is
140              transmitted as C/omenB0000.  If the resultant filename has  more
141              than  8  characters  in  the  stem, a "." is inserted to allow a
142              total of eleven.
143
144              This option enables the --full-path option.
145       --delay-startup N
146              Wait N seconds before doing anything.
147       -e, --escape
148              Escape all control characters; normally XON, XOFF, DLE, CR-@-CR,
149              and Ctrl-X are escaped.
150       Force the sender to rename the new file if a file with the same
151              name already exists.
152       -f, --full-path
153              Send  Full  pathname.   Normally directory prefixes are stripped
154              from the transmitted filename.
155
156              This is also turned on with to --dot-to-slash option.
157       -h, --help
158              give help.
159       -i COMMAND, --immediate-command COMMAND
160              Send COMMAND to the receiver for execution,  return  immediately
161              upon  the  receiving  program's successful reception of the com‐
162              mand.
163       -k, --1k
164              (XMODEM/YMODEM) Send files using 1024 byte  blocks  rather  than
165              the  default  128  byte  blocks.   1024  byte packets speed file
166              transfers at high bit rates.  (ZMODEM streams the data  for  the
167              best possible throughput.)
168       -L N, --packetlen N
169              Use  ZMODEM  sub-packets  of  length  N.  A larger N (32 <= N <=
170              1024) gives slightly higher throughput, a smaller N speeds error
171              recovery.   The  default  is  128  below 300 baud, 256 above 300
172              baud, or 1024 above 2400 baud.
173       -m N, --min-bps N
174              Stop transmission if BPS-Rate (Bytes Per Second) falls  below  N
175              for a certain time (see --min-bps-time option).
176       -M N, --min-bps-time
177              Used together with --min-bps. Default is 120 (seconds).
178       -l N, --framelen N
179              Wait for the receiver to acknowledge correct data every N (32 <=
180              N <= 1024) characters.  This may be used to avoid network  over‐
181              run when XOFF flow control is lacking.
182       -n, --newer
183              (ZMODEM)  Send  each  file  if  destination file does not exist.
184              Overwrite destination file if source file is newer than the des‐
185              tination file.
186       -N, --newer-or-longer
187              (ZMODEM)  Send  each  file  if  destination file does not exist.
188              Overwrite destination file if source file  is  newer  or  longer
189              than the destination file.
190       -o, --16-bit-crc
191              (ZMODEM) Disable automatic selection of 32 bit CRC.
192       -O, --disable-timeouts
193              Disable  read timeout handling. This makes lsz hang if the other
194              side doesn't send anything, but increases performance (not much)
195              and  decreases  system  load  (reduces number of system calls by
196              about 50 percent).
197
198              Use this option with care.
199       -p, --protect
200              (ZMODEM) Protect existing destination files by skipping transfer
201              if the destination file exists.
202       -q, --quiet
203              Quiet suppresses verbosity.
204       -R, --restricted
205              Restricted  mode:  restricts  pathnames to the current directory
206              and PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories
207              thereof.
208       -r, --resume
209              (ZMODEM)  Resume  interrupted file transfer.  If the source file
210              is longer than the destination file, the transfer  commences  at
211              the offset in the source file that equals the length of the des‐
212              tination file.
213       -s HH:MM, --stop-at HH:MM
214              Stop transmission at HH  hours,  MM  minutes.  Another  variant,
215              using +N instead of HH:MM, stops transmission in N seconds.
216       -S, --timesync
217              enable  timesync  protocol support. See timesync.doc for further
218              information.
219
220              This option is incompatible with standard zmodem.  Use  it  with
221              care.
222       --syslog[=off]
223              turn syslogging on or off. the default is set at configure time.
224              This option is ignored if no syslog support is compiled in.
225       -t TIM, --timeout TIM
226              Change timeout to TIM tenths of seconds.
227       -T, --turbo
228              Do not escape certain characters (^P,  ^P|0x80,  telenet  escape
229              sequence [CR + @]). This improves performance by about 1 percent
230              and shouldn't hurt in the normal case (but be careful - ^P might
231              be useful if connected through a terminal server).
232       --tcp  Try  to initiate a TCP/IP connection. lsz will ask the receiving
233              zmodem to open  a  TCP/IP  connection.  All  handshaking  (which
234              address / port to use) will be done by the zmodem programs.
235
236              You  will  normally  not want to use this option as lrzsz is the
237              only zmodem which understands what to  do  (private  extension).
238              You  might  want to use this option if the two programs are con‐
239              nected (stdin/out) over a slow or bad (not 8bit  clean)  network
240              connection.
241
242              Use  of this option imposes a security risk, somebody else could
243              connect to the port in between. See SECURITY for details.
244       --tcp-client ADDRESS:PORT
245              Act as a tcp/ip client: Connect to the given port.
246
247              See --tcp-server for more information.
248
249       --tcp-server
250              Act as a server: Open a socket, print out what to do,  wait  for
251              connection.
252
253              You  will  normally  not want to use this option as lrzsz is the
254              only zmodem which understands what to  do  (private  extension).
255              You  might want to use this if you have to use zmodem (for which
256              reason whatever), and cannot use the --tcp option of  lsz  (per‐
257              haps  because your telnet doesn't allow to spawn a local program
258              with stdin/stdout connected to the remote side).
259
260              If you use this option you have to start  lsz  with  the  --tcp-
261              client ADDRESS:PORT option.  lrz will print the address and port
262              on startup.
263
264              Use of this option imposes a security risk, somebody else  could
265              connect to the port in between. See SECURITY for details.
266
267       -u     Unlink the file after successful transmission.
268       -U, --unrestrict
269              Turn  off restricted mode (this is not possible if running under
270              a restricted shell).
271       -w N, --windowsize N
272              Limit the transmit window size to N bytes (ZMODEM).
273       -v, --verbose
274              Verbose output to stderr. More v's generate more output.
275       -X, --xmodem
276              use XMODEM protocol.
277       -y, --overwrite
278              Instruct a ZMODEM receiving program to  overwrite  any  existing
279              file with the same name.
280       -Y, --overwrite-or-skip
281              Instruct  a  ZMODEM  receiving program to overwrite any existing
282              file with the same name, and to skip any source  files  that  do
283              have a file with the same pathname on the destination system.
284       --ymodem
285              use ZMODEM protocol.
286       -Z, --zmodem
287              use ZMODEM protocol.
288

SECURITY

290       Restricted mode restricts pathnames to the current directory and PUBDIR
291       (usually /var/spool/uucppublic) and/or subdirectories thereof, and dis‐
292       ables remote command execution.
293
294       Restricted  mode  is entered if the R option is given or if lsz detects
295       that it runs under a restricted shell or if  the  environment  variable
296       ZMODEM_RESTRICTED is found.
297
298       Restricted mode can be turned of with the U option if not running under
299       a restricted shell.
300
301
302       Use of the
303              --tcp-client or --tcp-server options imposes a security risk, as
304              somebody  else  could  connect to the port before you do it, and
305              grab your data. If there's strong demand for a more secure  mode
306              i might introduce some sort of password challenge.
307
308
309

ENVIRONMENT

311       ZNULLS may  be  used  to  specify  the number of nulls to send before a
312              ZDATA frame.
313
314       SHELL  lsz recognizes a restricted shell if this variable includes  rsh
315              or rksh
316
317       ZMODEM_RESTRICTED
318              lrz enters restricted mode if the variable is set.
319
320       TMPDIR If  this  environment variable is set its content is used as the
321              directory to place in the answer file  to  a  timesync  request.
322              TMP  Used  instead  of  TMPDIR  if TMPDIR is not set. If neither
323              TMPDIR nor TMP is set /tmp will be used.
324

EXAMPLES

326       ZMODEM File Transfer (Unix to DSZ/ZCOMM/Professional-YAM)
327       % sz -a *.c
328       This single command transfers all .c files in the current  Unix  direc‐
329       tory with conversion (-a) to end of line conventions appropriate to the
330       receiving environment.  With ZMODEM AutoDownload enabled, Professional-
331       YAM   and ZCOMM will automatically receive the files after performing a
332       security check.
333
334       % sz -Yan *.c *.h
335       Send only the .c and .h files that exist on both systems, and are newer
336       on  the  sending system than the corresponding version on the receiving
337       system, converting Unix to DOS text format.
338       $ sz -\Yan file1.c file2.c file3.c foo.h baz.h ®(for VMS)
339
340       ZMODEM Command Download (Unix to Professional-YAM)
341        cpszall:all
342           sz -c "c:;cd /yam/dist"
343           sz -ya $(YD)/*.me
344           sz -yqb y*.exe
345           sz -c "cd /yam"
346           sz -i "!insms"
347       This Makefile fragment uses sz to issue commands to Professional-YAM to
348       change  current  disk  and directory.  Next, sz transfers the .me files
349       from the $YD directory, commanding the receiver to  overwrite  the  old
350       files  and  to convert from Unix end of line conventions to PC-DOS con‐
351       ventions.  The third line transfers some .exe files.   The  fourth  and
352       fifth  lines  command  Pro-YAM to change directory and execute a PC-DOS
353       batch file insms .  Since the batch file takes considerable  time,  the
354       -i form is used to allow sz to exit immediately.
355
356       XMODEM File Transfer (Unix to Crosstalk)
357       % sx -a foo.c
358       ESC
359       rx foo.c
360       The  above  three commands transfer a single file from Unix to a PC and
361       Crosstalk with sz translating Unix newlines to DOS CR/LF.  This  combi‐
362       nation is much slower and far less reliable than ZMODEM.
363

ERROR MESSAGES

365       "Caught  signal  99"  indicates  the program was not properly compiled,
366       refer to "bibi(99)" in rbsb.c for details.
367

SEE ALSO

369       rz(omen),   ZMODEM.DOC,   YMODEM.DOC,   Professional-YAM,    crc(omen),
370       sq(omen), todos(omen), tocpm(omen), tomac(omen), yam(omen)
371
372       Compile  time  options  required  for  various  operating  systems  are
373       described in the source file.
374

VMS VERSION

376       The VMS version does not support wild cards.  Because of VMS DCL, upper
377       case option letters muse be represented by \ proceeding the letter.
378
379       The current VMS version does not support XMODEM, XMODEM-1k, or YMODEM.
380
381       VMS C Standard I/O and RMS may interact to modify the file contents.
382

FILES

384       32 bit CRC code courtesy Gary S. Brown.
385
386       sz.c, crctab.c, rbsb.c, zm.c, zmodem.h Unix source files
387
388       sz.c,  crctab.c,  vrzsz.c,  zm.c,  zmodem.h,  vmodem.h,  vvmodem.c, VMS
389       source files.
390
391       /tmp/szlog stores debugging output (sz -vv) (szlog on VMS).
392

TESTING FEATURE

394       The command "sz -T file" exercises the Attn sequence error recovery  by
395       commanding  errors  with  unterminated  packets.  The receiving program
396       should complain five times about binary data packets  being  too  long.
397       Each  time sz is interrupted, it should send a ZDATA header followed by
398       another defective packet.  If the receiver does not  detect  five  long
399       data packets, the Attn sequence is not interrupting the sender, and the
400       Myattn string in sz.c must be modified.
401
402       After 5 packets, sz stops the "transfer" and prints the total number of
403       characters  "sent"  (Tcount).   The  difference between Tcount and 5120
404       represents the number of characters stored in various buffers when  the
405       Attn sequence is generated.
406

BUGS

408       Calling  sz  from  most  versions  of  cu(1)  doesn't work because cu's
409       receive process fights sz for characters from the modem.
410
411       On at least one BSD system, sz would hang or exit when it got within  a
412       few  kilobytes  of the end of file.  Using the "-w 8192" flag fixed the
413       problem.  The real cause is unknown, perhaps a bug in  the  kernel  TTY
414       output routines.
415
416       Programs  that  do  not  properly implement the specified file transfer
417       protocol may cause sz to "hang" the port for a  minute  or  two.   This
418       problem  is  corrected by using ZCOMM, Pro-YAM, or other program with a
419       correct implementation of the specified protocol.
420
421       Many programs claiming to support YMODEM only support  XMODEM  with  1k
422       blocks, and they often don't get that quite right.
423
424       XMODEM  transfers  add up to 127 garbage bytes per file.  XMODEM-1k and
425       YMODEM-1k transfers use 128 byte blocks to avoid extra padding.
426
427       YMODEM programs use the file length transmitted at the beginning of the
428       transfer  to prune the file to the correct length; this may cause prob‐
429       lems with source files that grow during the  course  of  the  transfer.
430       This  problem  does not pertain to ZMODEM transfers, which preserve the
431       exact file length unconditionally.
432
433       Most ZMODEM options are merely passed to the receiving program; some do
434       not implement all these options.
435
436       Circular  buffering  and  a  ZMODEM  sliding window should be used when
437       input is from pipes instead of acknowledging frames  each  1024  bytes.
438       If no files can be opened, sz sends a ZMODEM command to echo a suitable
439       complaint; perhaps it should check for the presence  of  at  least  one
440       accessible  file before getting hot and bothered.  The test mode leaves
441       a zero length file on the receiving system.
442
443       A few high speed modems have a firmware bug that drops characters  when
444       the  direction of high speed transmission is reversed.  The environment
445       variable ZNULLS may be used to specify the  number  of  nulls  to  send
446       before  a  ZDATA frame.  Values of 101 for a 4.77 MHz PC and 124 for an
447       AT are typical.
448
449
450
451lrzsz-0.12b                        2.6.1996                              SZ(1)
Impressum