trackrun - Record when the given command was started and ended and expose to it in environment variables



NAME

trackrun - Record when the given command was started and ended and expose to it in environment variables


SYNOPSIS

trackrun [OPTIONS] [--] COMMAND [ARGS]


DESCRIPTION

It records when it starts COMMAND and when it ends, identifying COMMAND either by one of 4 options:

Full command line including ARGS.
Only the command name, COMMAND.
By the name given by the user in NAME.
By the environment variable value given by name ENV.

Set TRACKRUN_LAST_STARTED and TRACKRUN_LAST_ENDED environments for COMMAND to the ISO 8601 representation of the date and time when COMMAND was last started and ended respectively. Set TRACKRUN_LAST_STATUS to the status COMMAND last exited with. Those are left empty if no data yet.

On every run, a UUID is generated, so you can connect events of concurrent runs in the track report. It is exposed in TRACKRUN_UUID env.


OPTIONS

-f, --full-command
-b, --command-basename (default)
-n, --name NAME
-e, --env-var ENV
-h, --show-hash

Show the hash generated from either of those options above before run the COMMAND. This hash is used for the filename in which command-related events are stored.

-u, --show-uuid

Show the current run's UUID before actually start the command.

-U, --write-uuid FILE

Write current run's UUID in the given file before start the command.

-R, --report

Do not run COMMAND, instead display its tracked history.


FILES

Store tracking data in ~/.trackrun directory.


ENVIRONMENT

TRACKRUN_LAST_STARTED
TRACKRUN_LAST_ENDED
TRACKRUN_LAST_STATUS
TRACKRUN_LAST_UUID
TRACKRUN_LAST_SUCCESSFUL_STARTED
TRACKRUN_LAST_SUCCESSFUL_ENDED
TRACKRUN_LAST_SUCCESSFUL_UUID

The last successful run's UUID, date-time when started and ended.

TRACKRUN_UUID

The current run's UUID


LIMITATIONS

Trackrun does not do locking. You may take care of it if you need using flock(1), cronrun(1), or similar.

 trackrun - Record when the given command was started and ended and expose to it in environment variables