pditvtrc (Periodically acquire the HiRDB status)
Function
The pditvtrc command executes a specified command at a specified interval (in seconds) and then outputs the termination status to the standard output or standard error output file.
Executor
Any user (with or without privileges). The execution permissions required by the command that is executed by the pditvtrc command apply.
Format
pditvtrc interval-in-seconds output-file-prefix file-size retained-generations-count command [arg1 [arg2] ...] |
Command arguments
Specifies the interval in seconds at which the specified command is to be executed. The specified value must be an integer of 0 or greater (if 0 is specified, the command will be executed consecutively).
If the specified command does not terminate within the specified interval, counting the seconds stops. When the specified command terminates, the pditvtrc command executes the next command and starts counting the seconds again. Even when the specified command terminates within the specified interval, an error may still occur with respect to the specified interval.
Specifies the prefix of the output file.
The actual output file name is output-file-prefixXX (00 XX < number of retained generations). If output-file-prefixXX already exists when the pditvtrc command starts, XX begins at YY + 1, where the most recent output file is output-file-prefixYY. However, if YY + 1 is equal to or greater than the number of retained generations and there is no output file with output-file-prefixXX, then XX begins at output-file-prefix00.
After executing the specified command, if the output file exceeds the specified file size, the pditvtrc command swaps output files and outputs the results of the command's execution to the output file named output-file-prefixXX, with XX incremented. When the value of XX reaches the specified number of retained generations, the value of XX is reset to 00 in wrap-around fashion. If this happens, the previous output files will be overwritten.
Each time an output file exceeds the specified file size, the pditvtrc command swaps the output files to retain a maximum of the specified number of generations of output files.
Specifies the maximum output file size in megabytes.
After executing the specified command, if the current output file named output-file-prefixXX exceeds this file size, the pditvtrc command swaps the current output files.
Specifies the number of output file generations to be retained.
The number of generations applies to the actual output file names. The number of output file generations is unlimited, but a maximum of the specified number of the newest output files are retained because the prefix of the output file can be 00 XX < number of retained generations.
Specifies the command to be executed and its arguments.
The syntax for the command line is the same as for normal commands. You can specify not only HiRDB operation commands but also any other commands.
Rules
Notes
Output format
YYYY/MM/DD HH:MM:SS ...............................................1 |
Explanation
For details about 2 and 3, see the applicable manual (for HiRDB commands, see the description of the applicable command in this manual).
Examples
pditvtrc 60 /outputdir/rpc 10 2 pdls -d rpc -a |
Example 2:
This example executes one pditvtrc command to execute multiple commands:
pditvtrc 60 /outputdir/trc 20 6 trcscript |
Contents of trcscript
#!/bin/posix/sh |