uucp Command Purpose Copies files from one system to another. Syntax uucp [ -c | -C ] [ -d | -f ] [ -gGrade ] [ -j ] [ -m ] [ -nUser] [ -r ] [ -sFile ] [ -xDebugLevel ] SourceFile... DestinationFile... Description The uucp command is a Basic Networking Utilities (BNU) command that copies one or more source files from one system to one or more destination files on another UNIX system. Files can be copied within a local system, between a local and a remote sys- tem, and between two remote systems. The uucp command accomplishes the file transfer in two steps: first, by creating a command ( C.*) file in the spooling directo- ry on the local computer and then by calling the uucico daemon to send the request to the specified computer. Command files in- clude information such as the full path name of the source and destination files and the sender's login name. The full path name of a command file is a form of the following: /var/spool/uucp/SystemName/C.SystemNameNxxxx where N is the grade of the request and xxxx is the hexadecimal sequence number used by BNU. If the uucp command is used with the -C flag to copy the files to the spool directory for transfer, the uucp command creates not only a command file, but also a data ( D.*) file that contains the actual source file. The full path name of a data file is a form of the following: /var/spool/uucp/SystemName/D.SystemNamexxxx### Once the command files (and data files, if necessary) are creat- ed, the uucp command then calls the uucico daemon, which in turn attempts to contact the remote computer to deliver the files. It is useful to issue the uuname command to determine the exact name of the remote system before issuing the uucp command. The uulog command provides information about uucp activities with another system. Source and Destination File Names File names and system names can contain only ASCII characters. Each can either be a path name on the local system or have the following form: SystemName! PathName where SystemName is taken from a list of system names that BNU knows about. The destination SystemName can also be a list of names, such as the following: SystemName!SystemName! . . . ! SystemName! PathName In this case, an attempt is made to send the file using the specified route to the destination. Make sure that intermediate nodes in this route are willing to forward information, and that they actually talk to the next system. The shell pattern-matching characters ? (question mark), * (as- terisk), and [ . . . ] (brackets and ellipsis) can be used in the path names of the source file; the appropriate system expands them. The shell pattern-matching characters should not be used in the path name of the destination file. If the DestinationFile is a directory rather than a file, the uucp command uses the last part of the SourceFile name to name the transferred file on the remote system. Path Names Path names for the SourceFile and DestinationFile parameters con- tain only ASCII characters. Paths for the source file can be one of the following: * A full path name * A relative path name. Paths for the DestinationFile parameter can be in the forms for the SourceFile parameter, or can be one of the following: * A path name preceded by \~User (for example, \~jkimble) where User is a login name on the remote system. The specified user's login directory is then considered the destination of the transfer. If the user specifies an invalid login name, the files are transferred to the public directory, /var/spool/uucppublic, which is the default. * A path name preceded by \~/Destination, where Destination is appended to /var/spool/uucppublic. The destination is treated as a file name unless more than one file is being transferred by the request, the destination already exists as a directory on the re- mote system, or the destination is specified as a directory. To specify the destination as a directory, follow the destination name with a / (slash). For example, \~/amy/ as the destination creates the directory /var/spool/uucppublic/amy, if it does not already exist, and puts the requested files in that directory. Permissions * The system administrator should restrict the access to local files by users on other systems. * When transmitting files, the uucp command preserves execute permissions and grants read and write permissions to the owner, the group, and all others. (The uucp command owns the file.) * Sending files to arbitrary DestinationFile path names on other systems or getting files from arbitrary SourceFile path names on other systems often fails because of security restrictions. The files specified in the path name must give read or write permis- sion not only for the same group of users but also for any group. * Protected files and files in protected directories owned by the requestor can be sent by the uucp command. Flags -c Prevents files from being copied. This flag is the default and should not be used with the -C flag. If both flags are specified, the -c flag is overridden. -C Copies local files to the spool directory for transfer. Depending on the configuration of the Poll and Systems files and on how often the uusched daemon is run, the files may be transferred immediately on demand polling or in the future. Occasionally, problems occur while transferring a source file; for example, the remote computer may not be working or the login attempt may fail. In such a case, the file remains in the spool directory until it is either transferred successfully or removed by a cleanup command. This flag counteracts the -c flag. -d Creates any intermediate directories needed to copy the source files to the destination files on a remote system. Instead of first creating a directory and then copying files to it, the uucp command can be entered with the destination path name, and the BNU Program will create the required directory. This flag is the default and cannot be used with the -f flag. -f Does not create intermediate directories during the file transfer. This flag is used if the destination directory already exists and you do not want BNU to write over it. This command counteracts the -d flag. -gGrade Specifies when the files are to be transmitted during a particular connection. The Grade variable is a single number (0 to 9) or letter (A to Z, a to z); lower ASCII-sequence characters cause the files to be transmitted earlier than do higher sequence characters. The number 0 is the highest (earliest) grade; z is the lowest (latest) grade. The default is N. -j Displays the job identification number of the transfer opera- tion on standard output. This job ID can be used with the uus- tat or uuq command to obtain the status of a particular job or with the uustat -k command or uuq -d command to terminate the transfer before it is completed. -m Sends a mail message to the requester when the source file is successfully copied to the destination file on a remote system. The message is sent to the requester's mailbox, /var/spool/mail/User. The mail command does not send a message for a local transfer. The -m flag works only when sending files or receiving a single file. It does not work when forwarding files. -nUser Notifies the recipient on the remote system identified by the User entry that a file has been sent. The mail system does not send a message for a local transfer. User names can contain only ASCII characters. Receiving multiple files specified by the shell pattern-matching characters ? (question mark), * (aster- isk), and [ . . . ] (brackets and ellipses) does not activate the -n option. -r Prevents the starting of the uucico file transfer daemon, even if the command was issued at a time when calls to the remote system are permitted. (By default, a call to the remote system is attempted if the command is issued during a time period speci- fied in the Poll and Systems files.) The -r option is useful for debugging. -sFile Reports the status of the transfer to the specified file. In this case, the File variable must designate a full path name. -xDebugLevel Displays debugging information on the screen of the local system. The DebugLevel variable is a number from 0 to 9. The higher the number, the more detailed the report. Examples 1. To copy a file from the local system to a remote system, enter: uucp /home/geo/f1 hera!/home/geo/f1 In this example, the f1 file from the local system is copied to remote system hera. 2. To copy a file from the remote system and place it in the pub- lic directory, enter: uucp hera!geo/f2 /var/spool/uucppublic/f2 In this example, the f2 file from remote system hera is copied and placed in the public directory. 3. To copy a file from the remote system and place it in a direc- tory other than the public directory, enter: uucp hera!geo/f2 /home/geo/f2 In this example, the f2 file from the remote system hera is copied to the /home/geo/f2 directory. The geo login directory must allow write permission to members of the other group, for example, with mode 777. Implementation Specifics This command is part of the Basic Networking Utilities Program (BNU) in BOS Extensions 1. Files /usr/bin/uucp Command path name. /etc/uucp/ Poll File listing times when remote systems are au- tomatically called (polled). /etc/uucp/Systems File describing accessible remote systems. /var/spool/uucp Spooling directory containing BNU status infor- mation. /var/spool/uucppublic Public directory containing files awaiting transfer by the uucico daemon. /var/spool/uucppublic/SystemName/ C.* Command files. /var/spool/uucppublic/SystemName/ D.* Data files. Related Information The ct command, cu command, mail command, uuclean command, uucleanup command, uulog command, uuname command, uupick com- mand, uuq command, uustat command, uuto command, uux command. The uucico daemon, uusched daemon.