IBM Tivoli Netcool/OMNIbus, Version 7.4

Creating a file

Use the CREATE FILE command to create an ObjectServer file.

Syntax

CREATE [ OR REPLACE ] FILE file_name 'path_to_physical_file'
[ MAXFILES number_files ]
[ MAXSIZE file_size { GBYTES | MBYTES | KBYTES | BYTES } ];

If there is a possibility that an ObjectServer file already exists with the same name as the one you want to create, use the optional OR REPLACE keywords. If the ObjectServer file does not exist, a new one is created. If the ObjectServer file exists, it is replaced by the one you are creating.

Note: If you do not use the OR REPLACE keywords, you must specify a physical file that does not already exist. If you use the OR REPLACE keywords, and the physical file already exists, the physical file is overwritten if there is no ObjectServer file associated with it.

The file name must be unique and comply with the ObjectServer naming conventions.

The path_to_physical_file is the full path and name of the corresponding file on the physical file system, for example, /log/out.log. On Windows platforms, you must escape the backslash (\) character (for example: c:\\tmp\\testfile.txt) or use the equivalent UNIX path (for example: c:/tmp/testfile.txt).

You can optionally set MAXFILES to specify the number of files in the file set. The default is 1. If you set MAXFILES to a value greater than 1, when the first file exceeds the maximum size, a new file is created. When that file exceeds the maximum size, another new file is created and the process is repeated until the maximum number of files in the set is reached. Then the oldest file is deleted and the process repeats.

Note: A number, starting with 1 and incremented depending on the number of files in the file set, is always appended to the specified file name (or file extension if there is one).

You can optionally set MAXSIZE to specify the maximum file size. After a record is written to the file that meets or exceeds that size, a new file is created. The default setting is 0. If set to 0, there is no maximum file size, and therefore the file set always consists of one file.

The minimum file size is 1 KB. The maximum size is 4 GB.

If the ObjectServer is restarted, new data is appended to the existing file.

Example

create file logit '/log/logfile'
maxfiles 3
maxsize 20 KBytes;

If you run this example command, the following sequence of files are created and used:

  1. The ObjectServer creates an empty file named logfile1 in the /log directory.
  2. The ObjectServer writes data to logfile1 until it exceeds the maximum file size of 20 KB.
  3. The ObjectServer renames logfile1 to logfile2. It then creates a new logfile1 and writes to this file until it exceeds the maximum size.
  4. The ObjectServer renames logfile2 to logfile3 and renames logfile1 to logfile2. It then creates a new logfile1 and writes to this file until it exceeds the maximum size.
  5. The ObjectServer deletes the oldest file (logfile3). It then renames logfile2 to logfile3 and renames logfile1 to logfile2. It creates a new file named logfile1 and writes to this file until it exceeds the maximum size.

This sequence is repeated until the file is altered or dropped.