Forrest logo
back to the systemd-run tool

systemd-run:tldr:30089

systemd-run: Start a transient timer that periodically runs its transient service (see `man systemd.time` for calendar event format).
$ sudo systemd-run --on-calendar=${calendar_event} ${command} ${argument1 argument2 ---}
try on your machine

The command you provided uses the systemd-run utility, which allows you to run a command as a systemd unit. Here's a breakdown of each part of the command:

sudo: This is a command to run another command as superuser (root). It prompts for the administrator password and grants temporary administrative privileges to the specified command.

systemd-run: This is the command used to create and manage systemd units. In this case, you are running it to start a new service unit.

--on-calendar=${calendar_event}: This option specifies the event on which the command should be executed. ${calendar_event} is a placeholder for a specific calendar event expression, which determines when the command should run. For example, you might use a specific date and time, recurring patterns, or relative time specifications.

${command}: This is a placeholder for the command you want to execute. Replace it with the actual command you want to run. For example, echo, ls -l, or any other valid command.

${argument1 argument2 ---}: These are placeholders for command arguments, if any. Replace them with the actual arguments you want to pass to the command specified above. Arguments are typically optional, and their purpose depends on the specific command being executed.

To use this command, replace ${calendar_event} with a valid calendar event expression, ${command} with the desired command, and provide any required arguments using ${argument1 argument2 ---}.

Here's an example usage:

sudo systemd-run --on-calendar=2022-01-01T12:00:00 /usr/bin/mycommand argument1 argument2

This would execute the command /usr/bin/mycommand with the arguments argument1 and argument2 on January 1, 2022, at 12:00:00.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the systemd-run tool