Friday, March 17, 2017

Run Reflector Through Systemd

I installed reflector as i've said in this post. Now I want to run reflector regularly so that whenever I do a pacman update I can be assured that the mirrors are also updated. Setting this weekly is I think reasonable enough. I want to use systemd to do this.

/etc/systemd/system/reflector.service

[Unit]
Description=Pacman mirrorlist update

[Service]
Type=oneshot
ExecStart=/usr/bin/reflector --verbose --latest 5 --sort rate --save /etc/pacman.d/mirrorlist

Save the file. Start the service.

To set this service every week.

/etc/systemd/system/reflector.timer
[Unit]
Description=Run reflector weekly

[Timer]
OnCalendar=weekly
RandomizedDelaySec=12h
Persistent=true

[Install]
WantedBy=timers.target

Save the file. Start the timer.
Post a Comment

Some Help You Are

Not all good motives end well. You thought you were doing somebody a favor but the other person is doing you mischief.