You are not logged in.
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
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
Offline
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.
xautolock.timer xautolock.service #locks screen
I don't suppose you could post those units? They sound very useful indeed.
Para todos todo, para nosotros nada
Offline
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.
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
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)
Ukrainian
Offline
Backup to blackblaze every hour
Offline
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
Offline
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.
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
@schard it's a user service.
Offline
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.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
I have not set a systemd timer that i made myself, i basically use no user-made timers.
Offline
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
┌─[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
Offline
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
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); '
Offline