Back

logappend

logappend -T <timestamp> -K <token> (-E <employee-name> | -G <guest-name>) (-A | -L) [-R <room-id>] <log>
logappend -B <file>

Appends data to the log at the specified timestamp using the authentication token. If the log does not exist logappend should print "invalid," exit with error code 255. Otherwise it will append to the existing log.

If the data to be appended to the log is not consistent with the current state of the log, logappend should print "invalid," exit with error code 255, and leave the state of the log unchanged.

Command line arguments can appear in any order. If the same argument is provided multiple times, the last value is accepted.

After logappend exits, the log specified by the log argument should be updated. The added information should be accessible to the logread tool when the token provided to both programs is the same, and not available (e.g., by inspecting the file directly) otherwise.

Return values and error conditions

If logappend must exit due to an error condition, or if the argument combination is incomplete or contradictory, logappend should print "invalid" to stdout and exit, returning a 255.

If the log to be appended already exists, and the supplied token does not match the expected token, "invalid" should be printed to stdout and 255 returned. (When a log file is first created, the supplied token becomes the valid token for all future accesses to that log.)

If -B is passed, logappend should return 0 as long as the batch file exists and valid arguments are given to the batch command. If the batch file does not exist, print "invalid" to stdout and exit, returning 255.

Some examples of conditions that would result in printing "invalid" and doing nothing to the log: