Skip to content

Instantly share code, notes, and snippets.

@brohee
Last active July 9, 2020 12:05
Show Gist options
  • Save brohee/8eb51df2bf23a7f21d3f926bb8bffcca to your computer and use it in GitHub Desktop.
Save brohee/8eb51df2bf23a7f21d3f926bb8bffcca to your computer and use it in GitHub Desktop.
systemd units to periodically update currencies for the unit command line

From the Hacker News comment https://news.ycombinator.com/item?id=23778922

In case anyone else needs this:

systemctl edit units-currency-update.service

[Unit]
Description=Update units(1) currency rates
  
[Service]
Type=oneshot
Nice=19
ExecStart=/usr/bin/units_cur

systemctl edit units-currency-update.timer

[Unit]
Description=Update units(1) currency rates
  
[Timer]
OnCalendar=daily
AccuracySec=3h
Persistent=true
  
[Install]
WantedBy=timers.target

systemctl daemon-reload

systemctl enable units-currency-update.timer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment