bbftpc (Index) | Updated: 2000/08/28 | Section: User Commands (1) |
bbftpc -v
bbftpc { -i ControlFile | -e Command } -m MagicNumber [ -b ] [ -c ] [ -o OutputFile ] [ -p NumberOfParallelStreams ] [ -r NumberOfTries ] [ -t ]
Use the bbftpc in conjunction with the bbftpcd command to transfer files between the local host and a remote host.
bbftpc does not realy do the transfer but communicate with the bbftpcd daemon which is the body that do the transfer.
bbftpc has been developped in order to have a command line that will do the transfer between the local host and a remote host without giving the username and the password on the remote host. Those data have been given to the bbftpcd once, and then, will never be asked anymore.
The bbftpd daemon has to be installed on the remote host in order to be able to transfer files and a bbftpcd daemon has to be started before any use of the bbftpc command
The behaviour of bbftpc is controled by the ControlFile (see CONTROL FILE FORMAT ) which contains the commands to be executed or by a single command in the same format. If a ControlFile is used, bbftpc also generates a ResultFile which is located in the same directory as the ControlFile (see RESULT FILE FORMAT ).
bbftpc may be used in one of the following ways:
bbftpc
bbftpc -v
bbftpc [ Options ] { -i ControlFile | -e Command } -m Magic Number
See OPTIONS section, for a full description of the Options.
The control file is an ASCII file containing the commands to be executed. Each line of the file represent one command. The following commands are available:
If the RemoteDirectory is given in relative mode (not beginning by a /), it is searched relative to the directory where the daemon is currently. After the first connection the current directory is the home directory of the RemoteUsername.
The client keep in mind the current remote directory so in case of broken connection during a transfer, it reset the current directory of the daemon to the correct directory
If the RemoteFile is given in relative mode (not beginning by a /), it is searched relative to the current directory on the remote host (which is set to the home directory of the RemoteUsername at the beginning).
If the LocalFile is given in relative mode (not beginning by a /) the file is created relative to the directory where the bbftpc command is running (which may have been changed with the lcd command).
If the RemoteFile is given in relative mode (not beginning by a /), it is searched relative to the current directory on the remote host (which is set to the home directory of the RemoteUsername at the beginning) and created on the local host relative to the directory where the bbftpc command is running (which may have been changed with the lcd command).
If the LocalDirectory is given in relative mode (not beginning by a /), it is searched relative to the directory where the client is currently.
If one directory in the path given does not exist the command fail and no retry is done.
If the LocalFile is given in relative mode (not beginning by a /) the file is searched relative to the directory where the bbftpc command is running (which may have been changed with the lcd command).
If the RemoteFile is given in relative mode (not beginning by a /), it is created relative to the current directory on the remote host (which is set to the home directory of the RemoteUsername at the beginning).
If the LocalFile is given in relative mode (not beginning by a /) the file is searched relative to the directory where the bbftpc command is running (which may have been changed with the lcd command) and created relative to the current directory on the remote host (which is set to the home directory of the RemoteUsername at the beginning).
On Linux all transfer commands are limited to files of 2 Gigabytes.
The
ResultFile
is created in the same directory as the
ControlFile.
Its name is ControlFile with the extension ".res". It contains the
same lines as the
ControlFile
plus the keyword OK, in case of success, or FAILED, in case of failure.
If the following control file named ctrlfile:
mkdir /scratch/jon
put /home/user/f1 /scratch/jon/f1
put f2 f3
get f4 /tmp/f5
has to be used. The first thing to do is to run a bbftpcd command like
bbftpcd -u jon host2
which will return a magic number like 5800 (the pid of the process running).
Then the command to start the transfer will be
bbftpc -i ctrlfile -p 5 -c - m 5800
This mean that the bbftpc command will used the ControlFile ctrlfile to execute several commands. All transfer commands will be done in compressed mode with five streams.
Commands 1 and 2 are done in absolute mode. Commands 3 is done relative to the directory where the bbftpc command is run for f2 and relative to the home directory of user jon on host2 for f3. Command 4 is done relative to the directory of user jon on host2 for f4 and in absolute mode for file f5.
The ResultFile whose name will be ctrlfile.res may contain :
mkdir /scratch/jon OK
put /home/user/f1 /scratch/jon/f1 FAILED
put f2 f3 OK
get f4 /tmp/f5 OK
This means that commands 1 3 and 4 were successfull and command 2 failed.
No return value is given if a ControlFile is used. In this case see the ResultFile or the standard output.
If a single command is used then bbftpc return -1 in case of failure and 0 in case of success.
Informative and error messages are written to the standard output file.
bbftpc was developed by Gilles Farrache (farrache@cc.in2p3.fr) at the Centre de Calcul de l'IN2P3 - Villeurbanne (FRANCE).