Create A Systemd Timer
Example: Running a Command Automatically After System Boot
1. Create a systemd service file, for example: test_timer.service
[Unit]
Description=Example Systemd Service File.
[Service]
Type=oneshot
User=<username>
ExecStart=/usr/bin/ping -c 10 google.com
[Install]
WantedBy=multi-user.target2. Now, create a timer file with the same name, for example: test_timer.timer
[Unit]
Description=Example Systemd Timer.
[Timer]
OnBootSec=5m
[Install]
WantedBy=timers.target3. Enable & Start the Systemd Timer
Last updated