lttng-rotate(1)
===============
:revdate: 14 June 2021


NAME
----
lttng-rotate - Archive the current trace chunk of an LTTng recording session


SYNOPSIS
--------
[verse]
*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *rotate* [option:--no-wait] ['SESSION']


DESCRIPTION
-----------
The `lttng rotate` command archives to the file system
the current trace chunk of:

With the 'SESSION' argument::
    The recording session named 'SESSION'.

Without the 'SESSION' argument::
    The current recording session (see man:lttng-concepts(7) to learn
    more about the current recording session).

This action is called a _recording session rotation_.

See man:lttng-concepts(7) to learn more about the recording session
rotation and trace chunk concepts.

You can use the `rotate` command:

* Any time the recording session is active.

* A single time once the recording session becomes inactive.

See man:lttng-concepts(7) to learn more about the activity of a
recording session.

By default, the `rotate` command ensures that LTTng finished performing
the recording session rotation before it prints the path of the archived
trace chunk and exits. The printed path is absolute when the recording
session was created in normal mode and relative to the base output
directory of the relay daemon (see the nloption:--output option of
man:lttng-relayd(8)) when it was created in network streaming mode (see
man:lttng-create(1)).

Make the command exit immediately with the option:--no-wait option. In
this case, there's no easy way to know when the current trace chunk
becomes archived, and the command does :not: print the path of the
archived trace chunk.

Because LTTng flushes the current sub-buffers of the selected recording
session when it performs a recording session rotation, archived trace
chunks are never redundant, that is, they do not overlap over time like
snapshots can (see man:lttng-snapshot(1)). Also, a rotation does :not:
directly cause discarded event records or packets.

A `rotate-session` trigger action can also rotate a recording session
(see man:lttng-add-trigger(1)).

See the ``<<examples,EXAMPLES>>'' section below for usage examples.

[IMPORTANT]
====
You may only use the `rotate` command when:

* The selected recording session was created in normal mode or in
  network streaming mode (see man:lttng-create(1)).

* LTTng is not currently performing an immediate rotation (this
  command).
====


include::common-lttng-cmd-options-head.txt[]


option:-n, option:--no-wait::
    Do not ensure that the recording session rotation operation is
    completed before exiting.


include::common-lttng-cmd-help-options.txt[]


include::common-lttng-cmd-after-options.txt[]


[[examples]]
EXAMPLES
--------
.Rotate the current recording session.
====
[role="term"]
----
$ lttng rotate
----
====

.Rotate a specific recording session.
====
[role="term"]
----
$ lttng rotate my-session
----
====

.Rotate the current recording session without waiting for completion.
====
See the option:--no-wait option.

[role="term"]
----
$ lttng rotate --no-wait
----
====


include::common-footer.txt[]


SEE ALSO
--------
man:lttng(1),
man:lttng-disable-rotation(1),
man:lttng-enable-rotation(1),
man:lttng-concepts(7)
