So I'd like to set up a cronjob in a very specific way:
run script_A on boot/wake
then every 5 minutes after, relative to that boot/wake (so not just modulo-5 clock-minutes)
run script_B on each of the 4 minutes in between (ie the minutes when script_A does not run)
I'm really inexperienced in this whole thing,
so I'm looking for advice on what to start digging into first...
cron itself (or maybe it's technically anacron I'm using?) seems quite limited,
and the best it can do is apparently
*/5 * * * * /home/username/script_A.sh
fcron seems a bit more powerful/flexible, including some syntax for:
@ 5 /home/username/script_A.sh
which seems to get the part "every 5 minutes starting relative to boot/wake, not just modulo clock-minutes"
[... although I note stackexchange doesn't have fcron as an available tag, so that's maybe not a good sign...]
Still no clue how to handle "script_B on each of the 4 minutes in between script_A", though.
What are systemd timers like?
From a very superficial first glance, they look kinda boiler-plate-y verbose...?
But maybe they do have the power/flexibility I'm looking for...?
Is there anything else I should look into?
(
I'm on opensuse tumbleweed, so like,
I know for instance if I do go with fcron
it's gonna take a little work to make sure I've really got it installed properly
because I have to do so manually.
(
ie, I did install it from the github already,
but I'm pretty sure there's at least one or two tricky bits I need to track down to actually get it correctly integrated into my system.
)
What I do have in my package manager's repos is:
$zypper info cron cronie cronie-anacron kcron
#=>
Loading repository data...
Reading installed packages...
Information for package cron:
-----------------------------
Repository : Main Repository (OSS)
Name : cron
Version : 4.2-91.3
Arch : x86_64
Vendor : openSUSE
Installed Size : 181 B
Installed : Yes (automatically)
Status : up-to-date
Source package : cronie-1.6.1-91.3.src
Upstream URL : https://github.com/cronie-crond/cronie
Summary : Auxiliary package
Description :
Auxiliary package, needed for proper update from vixie-cron 4.1 to cronie 1.4.4
Information for package cronie:
-------------------------------
Repository : Main Repository (OSS)
Name : cronie
Version : 1.6.1-91.3
Arch : x86_64
Vendor : openSUSE
Installed Size : 310.2 KiB
Installed : Yes (automatically)
Status : up-to-date
Source package : cronie-1.6.1-91.3.src
Upstream URL : https://github.com/cronie-crond/cronie
Summary : Cron Daemon
Description :
cron automatically starts programs at specific times. Add new entries
with "crontab -e". (See "man 5 crontab" and "man 1 crontab" for
documentation.)
Under /etc, find the directories cron.hourly, cron.daily, cron.weekly,
and cron.monthly. Scripts and programs that are located there are
started automatically.
Information for package cronie-anacron:
---------------------------------------
Repository : Main Repository (OSS)
Name : cronie-anacron
Version : 1.6.1-91.3
Arch : x86_64
Vendor : openSUSE
Installed Size : 43.6 KiB
Installed : Yes
Status : up-to-date
Source package : cronie-1.6.1-91.3.src
Upstream URL : https://github.com/cronie-crond/cronie
Summary : Utility for running regular jobs
Description :
Anacron becames part of cronie. Anacron is used only for running regular jobs.
The default settings execute regular jobs by anacron, however this could be
overloaded in settings.
Information for package kcron:
------------------------------
Repository : Main Repository (OSS)
Name : kcron
Version : 23.04.3-1.1
Arch : x86_64
Vendor : openSUSE
Installed Size : 410.8 KiB
Installed : No
Status : not installed
Source package : kcron-23.04.3-1.1.src
Upstream URL : https://www.kde.org
Summary : Cron job configuration tool
Description :
KCron allows you to change your cron jobs setup.
(plus whatever might be in https://software.opensuse.org/search?baseproject=ALL&q=cron and I just don't know what to search for)
)