17.19 deletelog (deleting operation logs on the site server)
Functionality
This command deletes operation log data for a specified period of time from the site server.
Use this command to delete any unnecessary operation logs if the disk space on the server is running out due to increasing logged data.
If this command is executed when the site server is started, the server stops during the command execution. The site server starts again when the command is completed. If this command is executed when the site server is stopped, the server remains stopped after the command is completed.
Execute this command on a site server.
Format
deletelog {-date date|-days number-of-days}[ -reorg][ -work work-folder-name][ -s]
Arguments
- -date date
-
Specify a base-point date (using the site server's local time) to delete operation logs. Operation logs of the base-point date and older will be deleted.
The date should be specified in YYYY-MM-DD format.
-
YYYY: year (1970-9990)
-
MM: month (01-12)
-
DD: day (01-31)
If an invalid date is specified, the command returns an error. If you specify the exact date when this command is executed, or specify a future date, all operation logs will be deleted. The command returns an error if the operation log does not exist on the specified date.
Operation logs are managed on an hour-by-hour basis. If the command is executed in a time zone where the time difference from UTC is 15 or 30 minutes after the hour, the operation logs might only be deleted up to 23:45 or 23:30.
-
- -days number-of-days
-
Specify the number of days for operation logs to be retained in the database. Operation logs for the time period of days specified here will be retained in the database, starting from the exact date when the command was executed. Other logs older than this period will be deleted.
Specify the number of days in the range 0-9999. When 0 is specified, all operation log data will be deleted.
Operation logs are managed on an hour-by-hour basis. If the command is executed in a time zone where the time difference from UTC is 15 or 30 minutes after the hour, the operation logs might only be deleted up to 23:45 or 23:30.
- -reorg
-
Specify this to reorganize the database when operation logs are deleted.
If operation logs are deleted repeatedly, the database might be fragmented, causing reduced access speed to the database and other problems. If database access speed is reduced, add -reorg to the command to reorganize the database along with deleting the logs.
- -work work-folder-name
-
Specify the absolute path to the backup folder in which the operation logs to remain in the database will be backed up. Only folders in the local drive can be specified.
The folder name must be 120 characters or less. Half-width alphanumeric characters, white space, and the following special characters are allowed:
"#" "@" "\" ":" "."(period) "(" ")"
If the specified folder does not exist, a new folder will be created.
When this argument is omitted, the folder below is used as a work folder:
data-folder\SITE\OPLOG\DELETELOG
- -s
-
A confirmation prompt pops up during command execution. Specify this argument if you don't want the message to appear.
Storage location
site-server-installation-folder\mgr\bin\
Notes
-
If the command stops due to a failure or is canceled by an administrator, the delete process of the operation logs will be aborted. Execute the command again to resume the delete operation. Arguments other than -s remain specified in the same condition used for the previous execution. A confirmation message comes up when resuming the command.
The deletelog command records the progress status. This feature automatically applies the last conditions used for the command when it is re-executed, so that the operation logs are deleted correctly. However, if the progress status fails to be reloaded, you are not asked whether to continue re-execution. In this case, create the index information for the operation logs again by executing recreatelogdb command with -all specified in order to be able to refer to the remaining operation logs.
-
The work folder requires enough free space to run the delete operation. The following is the equation for estimating the work folder capacity:
Required size for the work folder (in bytes) = number of operation logs to retain in database x 67 + number of computers connecting to the site server to obtain distributed operation logs x (1,066 + number of days to retain operation logs in database x 500)
-
Execute this command when site server setup is completed.
-
This command cannot be simultaneously executed by multiple users.
Return value
The following table shows the return values of the deletelog command.
Return value |
Description |
---|---|
0 |
The command finished normally. |
1 |
A warning was raised during command execution. The command stopped. |
2 |
Operation log data to delete does not exist. |
11 |
The format for specifying the command arguments is invalid. |
12 |
An invalid work folder was specified. |
13 |
An invalid date was specified. |
31 |
Another command is being executed. |
51 |
You do not have the permissions to execute this command. |
54 |
The site server has not been set up. |
62 |
A file access error occurred. |
66 |
The work folder does not have enough free space. |
101 |
The command execution failed due to not enough memory or some other reason. |
102 |
Failed to automatically stop the site server. |
103 |
Failed to report information to the management server. |
120 |
A database access error occurred. |
Example
The following example uses this command to delete operation log data stored in the site server, leaving operation logs for 120 days, beginning with the date when the command is executed, and then reorganize the database.
deletelog -days 120 -reorg
Related Topics: