Книга: Fedora™ Unleashed, 2008 edition

External Command

External Command

The external command entries in the ftpconversions file contain the bulk of the FTP server conversion rules. The external command entry tells the server what should be done with a file after it is transferred to the server. The specified conversion utility can be any command on the server, although generally it is a compression utility. As the file is sent, the server passes the file through the external command. If the file is being uploaded to the server, the command needs to send the result to standard in, whereas a download sends the result to standard out. For example, here is an entry specifying the tar command:

: : :.tar:/bin/tar -c -f - %s:T_REG|T_DIR:O_TAR:TAR

The following sections describe the fields in a conversion entry.

Types

You must use the types field of the ftpconversions file to tell the server to what types of files the conversion rules apply. Separate the file type entries with the (|) character, and give each type a value of T_REG, T_ASCII, and T_DIR.

T_REG signifies a regular file, T_ASCII an ASCII file, and T_DIR a directory. A typical entry is T_REG | T_ASCII, which signifies a regular ASCII file.

Options

The options field informs the server what action is being done to the file. Similar to the types field, options are separated by the (|) character. Here are the valid ranges you can assign to items in the options field:

O_COMPRESS to compress the file

O_UNCOMPRESS to uncompress the file

O_TAR to tar the file

An example of this field is O_COMPRESS | O_TAR, where files are both compressed and TARed.

Description

The description field allows an administrator to quickly understand what the rule is doing. This field does not have any syntax restriction, although it is usually a one-word entry—such as TAR, TAR+COMPRESS, or UNCOMPRESS — which is enough to get the concept across.

Оглавление книги


Генерация: 0.875. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз