Change a Timer's Schedule

Linux lab Intermediate 3 tasks 20 points

The metrics.timer is firing far too often. Change its schedule to run once a day instead, and apply the change. Password: student.

How it works: the terminal below is a real Linux machine running in your browser. Click it and type. Tasks tick themselves off as you complete them; questions are answered in the box under each task. Press Reset any time for a fresh machine. Your password on this machine (for sudo) is student.

student@vulntech:~ Starting…
Getting your Linux machine ready…
The first start downloads about 20 MB. After that your browser keeps it, and labs start in a moment.

Hints

sed -i 's#^OnCalendar=.*#OnCalendar=daily#' FILE rewrites the schedule line.

Editing a unit does nothing until daemon-reload — then restart.

Solution explanation

Changing the OnCalendar= line in metrics.timer from *:0/2 (every two minutes) to daily sets the new schedule, but the file on disk isn't live until systemctl daemon-reload re-reads it and restart applies it to the running timer. list-timers then shows the new, later next-run time.

Show solution
sudo sed -i 's#^OnCalendar=.*#OnCalendar=daily#' /etc/systemd/system/metrics.timer
sudo systemctl daemon-reload
sudo systemctl restart metrics.timer
systemctl list-timers metrics.timer --no-pager
HOME LEARN COMMUNITY DASHBOARD