You are not logged in.

#1 2020-01-18 02:29:57

eric.meehan
Member
Registered: 2020-01-01
Posts: 52

What Systemd Timers Are You Running?

Hello fellow people!

I am just curious what tasks you have automated on your computers using systemd timers. I currently have two:

The first runs a python script every 10 minutes that checks the Price of bitcoin, then makes buy and sell decisions based on that information. It has currently made $17!

The second is and IP check. On my stationary computer, it checks every day at midnight and emails me if the IP address has changed. I also have this one running on a raspberry pie that I bring around with me, so that one runs every 10 minutes.

The second is and IP check. On my stationary computer, it checks every day at midnight and emails me if the IP address has changed. I also have this one running on a raspberry pie that I bring around with me, so that one runs every 10 minutes.

I’d love to hear how you guys have put automations to work!

Last edited by eric.meehan (2020-01-18 02:31:02)

Offline

#2 2020-01-18 03:43:30

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: What Systemd Timers Are You Running?

 UNIT            ACTIVATES
mbsync.timer    mbsync.service          #fetches mail
updates.timer   updates.service         #checks for updates in repo and AUR
backup.timer    backup.service          #rsyncs backup once a day
cacheshot.timer cacheshot.service       #rsyncs pacman cache once a month
xautolock.timer xautolock.service       #locks screen

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-01-18 11:07:10

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,679
Website

Re: What Systemd Timers Are You Running?

UNIT                         ACTIVATES
anacron.timer                anacron.service
logrotate.timer              logrotate.service
man-db.timer                 man-db.service
systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
fstrim.timer                 fstrim.service
btrfs-scrub@-.timer          btrfs-scrub@-.service

Only fstrim & btrfs-scrub are mine though.

jasonwryan wrote:
xautolock.timer xautolock.service       #locks screen

I don't suppose you could post those units? They sound very useful indeed.

Offline

#4 2020-01-18 14:23:20

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,932
Website

Re: What Systemd Timers Are You Running?

My home server:

0 ✓ rne@homesrv ~ $ systemctl list-timers --no-pager
NEXT                         LEFT          LAST                         PASSED     UNIT                              ACTIVATES
Sat 2020-01-18 15:30:00 CET  7min left     Sat 2020-01-18 15:00:13 CET  22min ago  minecraft-datetime@survival.timer minecraft-datetime@survival.service
Sat 2020-01-18 15:30:00 CET  7min left     Sat 2020-01-18 15:00:13 CET  22min ago  minecraft-fortune@survival.timer  minecraft-fortune@survival.service
Sat 2020-01-18 16:00:00 CET  37min left    Sat 2020-01-18 15:00:13 CET  22min ago  minecraft-backup@survival.timer   minecraft-backup@survival.service
Sat 2020-01-18 16:02:48 CET  40min left    Sat 2020-01-18 15:03:06 CET  19min ago  ddnss@conqp.ddnss.de.timer        ddnss@conqp.ddnss.de.service
Sat 2020-01-18 21:49:49 CET  6h left       Fri 2020-01-17 21:49:49 CET  17h ago    systemd-tmpfiles-clean.timer      systemd-tmpfiles-clean.service
Sun 2020-01-19 00:00:00 CET  8h left       Sat 2020-01-18 00:00:05 CET  15h ago    man-db.timer                      man-db.service
Sun 2020-01-19 00:00:00 CET  8h left       Sat 2020-01-18 00:00:05 CET  15h ago    shadow.timer                      shadow.service
Sun 2020-01-19 00:27:32 CET  9h left       Sat 2020-01-18 00:45:43 CET  14h ago    certbot.timer                     certbot.service
Sun 2020-01-19 01:15:51 CET  9h left       Sat 2020-01-18 01:50:49 CET  13h ago    minecraft-backup-cleanup.timer    minecraft-backup-cleanup.service
Mon 2020-01-20 00:00:00 CET  1 day 8h left Mon 2020-01-13 00:00:45 CET  5 days ago paccache.timer                    paccache.service

10 timers listed.
Pass --all to see loaded but inactive timers, too.

Offline

#5 2020-01-30 13:20:20

webcapcha
Member
Registered: 2019-02-14
Posts: 101

Re: What Systemd Timers Are You Running?

UNIT                         ACTIVATES
logrotate.timer              logrotate.service
man-db.timer                 man-db.service
shadow.timer                 shadow.service
systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
fstrim.timer                 fstrim.service
paccache.timer               paccache.service
reflector.timer              reflector.service

7 timers listed.

Last edited by webcapcha (2020-01-30 13:21:26)

Offline

#6 2020-02-05 07:01:44

killdashnine
Member
Registered: 2020-02-04
Posts: 5

Re: What Systemd Timers Are You Running?

Backup to blackblaze every hour

Offline

#7 2020-02-05 07:11:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: What Systemd Timers Are You Running?

Head_on_a_Stick wrote:
jasonwryan wrote:
xautolock.timer xautolock.service       #locks screen

I don't suppose you could post those units? They sound very useful indeed.

Sure:

[Unit]
Description=Lock screen after a few minutes of inactivity

[Service]
Type=simple
ExecStart=/usr/bin/xautolock -time 8 -locker "/usr/bin/slock" -nowlocker "/usr/bin/slock" -detectsleep

[Install]
WantedBy=default.target

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2020-02-05 07:26:24

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,932
Website

Re: What Systemd Timers Are You Running?

Just nitpicking here, but you maybe shouldn't use default.target in the install section, since it is just a symlink to an arbitrary actual target file set by systemctl set-default.
You should use graphical.target, multi-user.taget or whatever target you actually want it to start with.
That being said, since this is a mainly timer driven unit for timed screen locking, one can argue whether you even need an install section at all.

Offline

#9 2020-02-05 18:06:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: What Systemd Timers Are You Running?

@schard it's a user service.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2020-02-06 03:50:16

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: What Systemd Timers Are You Running?

Besides the obvious backup and certbot tasks, I'm using timers heavily at local radio station. Timers to download syndicated news and other programs, manage audio logging files, update weather HUD displays from OpenWeatherMap API.

Offline

#11 2020-02-20 02:31:52

miss_looptux
Member
From: US, MO
Registered: 2020-02-20
Posts: 4

Re: What Systemd Timers Are You Running?

I have not set a systemd timer that i made myself, i basically use no user-made timers.

Offline

#12 2020-02-20 02:33:15

miss_looptux
Member
From: US, MO
Registered: 2020-02-20
Posts: 4

Re: What Systemd Timers Are You Running?

webcapcha wrote:
UNIT                         ACTIVATES
logrotate.timer              logrotate.service
man-db.timer                 man-db.service
shadow.timer                 shadow.service
systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
fstrim.timer                 fstrim.service
paccache.timer               paccache.service
reflector.timer              reflector.service

7 timers listed.

Is logrotate included with the arch linux install?
Or did you install that separate?
and where did you get the systemd-tmpfiles-clean.timer? i want it lol

Last edited by miss_looptux (2020-02-20 02:33:45)

Offline

#13 2020-02-20 02:35:40

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: What Systemd Timers Are You Running?

┌─[Veles ~]
└─╼ pacman -F systemd-tmpfiles-clean.timer
core/systemd 238.76-1 (base-devel) [installed: 244.3-1]
    usr/lib/systemd/system/systemd-tmpfiles-clean.timer
    usr/lib/systemd/system/timers.target.wants/systemd-tmpfiles-clean.timer
    usr/lib/systemd/user/systemd-tmpfiles-clean.timer

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2020-02-20 13:01:58

sammiev
Member
Registered: 2018-12-22
Posts: 84

Re: What Systemd Timers Are You Running?

UNIT                         ACTIVATES
systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
hosts-updater.timer          hosts-updater.service
logrotate.timer              logrotate.service
man-db.timer                 man-db.service
shadow.timer                 shadow.service
updatedb.timer               updatedb.service
fstrim.timer                 fstrim.service
pamac-cleancache.timer       pamac-cleancache.service

Offline

#15 2020-02-20 21:13:10

merlock
Member
Registered: 2018-10-30
Posts: 233

Re: What Systemd Timers Are You Running?

System Timers:

UNIT                         ACTIVATES
asd-resync.timer             asd-resync.service                 # anything-sync-daemon
systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
logrotate.timer              logrotate.service
man-db.timer                 man-db.service
pkgfile-update.timer         pkgfile-update.service
shadow.timer                 shadow.service
updatedb.timer               updatedb.service
auto-resume.timer            auto-resume.service                # wake up @ 0200 for maintenance
fstrim.timer                 fstrim.service
paccache.timer               paccache.service
reflector.timer              reflector.service

User timers

UNIT               ACTIVATES
modprobed-db.timer modprobed-db.service      # https://wiki.archlinux.org/index.php/Modprobed-db
psd-resync.timer   psd-resync.service        # profile-sync-daemon
getcal.timer       getcal.service            # syncs online calendar with remind
snapshot.timer     snapshot.service          # inspired by https://wiki.archlinux.org/index.php/Rsync#Snapshot_backup
syssnapshot.timer  syssnapshot.service       # same for snapshot, but for system (excluding $HOME)
suresleep.timer    suresleep.service         # go back to sleep after maintenance is done
backup.timer       backup.service            # sync backups to NAS (weekly)

Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '

Online

Board footer

Powered by FluxBB