uucp - Copy files between remote UUCP systems

Format

uucp [-Ccdfjmr] [-g grade] [-n user] [-x debug_level] [site1!] file1 [site2!] file2

uucp [-Ccdfjmr] [-g grade] [-n user] [-x debug_level] file... [site2!] directory

Description

uucp copies a source file or files from one site to a target on another site. The source can be a file or group of files specified by metacharacters. The source cannot be a directory. The target can be a corresponding file name or directory.

File names given to uucp have the form:
[site!] pathname
or
[site1![site2!]... pathname

where site names the remote site. If a site is not specified, pathname is a path name on your machine. site must be on the list of site names that uucp knows about. Use uuname to list sites that are known to uucp.

You can also specify multiple site names as a way of sending files to a site that your system does not have a direct connection to. File names that contain multiple site names are called multinode or multihop names. When processing a uucp request involving multihop names, only the destination name can be a multihop name. The source file name cannot be a multihop name.

The path names can have one of these forms:
  • A full path name.
  • A path name preceded by ~name/, where ~name is replaced on the specified site by the login directory of user name.
  • A path name preceded by ~/, where ~/ is replaced on the specified site with the name of the public UUCP directory.
  • A file name or prefix name containing the current directory on your machine as a prefix.

Destination path names cannot begin with exactly two slashes, which indicate an MVS™ file name.

If the target is a directory, you must append / to the end of the path name to ensure that it is not treated as a file. If the / is not appended to a directory name, then the name is treated as a file name and multiple copies to that command will behave like the cp command. That is, each subsequent copy will overlay the previous one.

Path names can contain the shell metacharacters ?, *, and [ ]. The character ~ also has a special meaning, as previously described. The appropriate site expands these characters after encountering them.If the destination file is a multihop name, then the source file cannot contain shell metacharacters because uucp uses uux to handle multihop requests, and uux does not allow shell metacharacters in names. Be careful when using metacharacters, because expansions on other sites may occur in unforeseen ways. For more information about metacharacters and their expansion by the shell, see sh.

Options

-C
Copies named files to the spool directory for transfer. If both this option and the -c option are given, this option takes precedence. This option is useful if you will be changing the file after running the uucp command and want to send the version of the file before you changed it.
-c
Does not copy files to the spool directory for transfer. This is the default.
-d
Makes all necessary intermediate directories to complete file transfer. This is the default.
-f
Does not make intermediate directories. If -f is specified with the -d option, -f takes precedence.
-g grade
Sets the priority of this job to grade. It is a number (0-9) or letter (A-Z, a-z), where 0 is the highest priority and z is the lowest.
-j
Passes the UUCP job ID number to standard output; this job ID can be used with uustat to determine the job's status or to terminate it. If uucp generates several job requests and several job IDs, only the last one appears.
-m
Sends mail notifying you when the copy finishes. The default is to send mail only if an error occurs that prevents the copy from being made.
-n user
Notifies the user at the destination site when a file you sent to the destination site arrives. This option has no effect when you use uucp to get files from the remote system.
-r
Queues the job to be processed later. Do not start uucico to begin transferring the file.
-x debug_level
Sets the verbosity of the debugging information to the specified debug level, which is a number, 0 or greater. Level 0 provides tersed messages while level 9 provides verbose messages. Values greater than 9 give no additional information. The default level is 0.
Options are not passed on to remote sites when the destination of your uucp command is a multihop name. For this uucp command:
uucp -mf file1 site1!site2!/file1
the -m and -f options are ignored. For multihop, uucp creates a uux request to run a uucp command at the next site (site1 in our example). But because site1 can be any system that supports uucp, it is possible that this particular system might not support the same options that are supported by uucp. For that reason, options are not passed to the uucp command to be run at site1.
To summarize the restrictions when using multihop destination names:
  • Options are not passed.
  • Shell metacharacters cannot be used in source file names.

Examples

  1. To copy the file /notes/memo from your site to a file named minutes in the public UUCP directory on a site named south:
    uucp /notes/memo south! ~/minutes
  2. You can also copy files locally. To copy the file resume.txt on your site to the file /business/resumes/november on your site:
    uucp resume.txt /business/resumes/november

    You must have read permission on the current directory. If the directories business/resumes do not exist, they are created if you have write permission in /.

  3. To copy the file index from the public UUCP directory on north to the current directory on the local site:
    uucp north! ~/index

    You must have write permission on the current directory.

  4. To copy the file index from the public UUCP directory on south to the subdirectory south/records in the public UUCP directory on the current site:
    uucp -f -m south! ~/index ' ~/south/records/'

    You must protect the tilde so the shell does not expand them to the user's home directory. If the subdirectory south/records does not exist, the file copy fails. Mail is sent to you when the transfer is completed successfully.

  5. You want to copy a file from your system to the site named east. Your system does not have a connection to east, but you do have a connection to north, and north has a connection to east:
    uucp memo north!east! ~/memo
  6. You want to use shell metacharacters to specify the files to be transferred to a remote site.
    In this command, the source path name is expanded by the shell. The uucp command succeeds if there is at least one file that matches the name specification:
    uucp /mystuff/file?.[ab&]* remote!/tmp/
    In this command, the source path name is not expanded by the shell, because it cannot find any matching file. The '!' is not allowed, because uucp interprets all '!' characters as delimiting system names.
    uucp remote!/tmp/file?.[!b]* /mystuff/

Environment variables

uucp uses the following environment variable:
TZ
Sets the time zone used with date and time messages

Localization

uucp uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_COLLECT
  • LC_CTYPE
  • LC_MESSAGES
  • LC_TIME

Files

uucp uses the following files:
/usr/lib/uucp/config
UUCP configuration file generated by uucc.
/usr/spool/uucp/LOGFILE
Log file for uucp and other UUCP utilities.
/usr/spool/uucppublic
Public UUCP directory.
/usr/spool/uucp/.Sequence/sitename
Sequence files, one for each remote site.

Usage notes

uucp does not convert files to or from EBCDIC. If a text file is sent from an ASCII system to an MVS system, it must be converted to EBCDIC after its arrival. Similarly, if an EBCDIC text file is sent to an ASCII system, the file is not automatically converted to ASCII. The receiving user must convert the file to ASCII.

Exit values

0
Successful completion.
1
Failure due to any of the following reasons:
  • Inability to open log file.
  • Insufficient memory.
  • Ctrl-C interrupt.
2
Unknown command-line option.

uucp can also have partial failures, where a file is inaccessible or a host could not be determined. uucp returns the 1 exit value and logs the partial failure in the log file /usr/spool/uucp/LOGFILE. Files that were accessible or had a known host are still queued for transfer.

Portability

X/Open Portability Guide, UNIX systems.

The -g option is an extension to the POSIX standard.

Related information

uucc, uucico, uulog, uux