Hi guys, I messed up . Instead of appending a root cron line in my managed servers I truncated it with the new line. I don’t have backups of the cron jobs, so now I’m having to recreate them manually.
So, for my own cron jobs it was fine, there were not many root crons anyway, and I had it all documented. However, i remember there was a bunch of .pl scripts that was setup by webmin/virtualmin/cloudmin, and since brilliant me ran it as a cluster command in Cloudmin on all my servers, I can’t even use one as reference. I was wondering if there is a way to trigger recreation of these root cronjobs, since they were setup when I installed webmin. Is it possible?
P.S.: The next day after this, I noticed some services like Bind DNS was offline in the morning. I wonder if one of the webmin cron jobs was automatically reloading it when crashing and I didn’t notice?
Yes, I checked up some docs but didn’t find what I was looking for.
I know how to manage cron jobs using webmin, the question is recreating the webmin jobs that are setup automatically when you install it.
The closest thing I found was this under webmin config:
About Centos7 being EOL, yea, I do plan to migrate to Rocky Linux, I have a bunch of servers and have a quite complex provisioning routine, so recreating my infra structure is in my priority list
OK. Now I’m a little clearer on what you want. I just checked my cron list and manually recreating would be ugly.
Found this for bind in case it helps.
root@main:/etc/cron.daily# cat /etc/webmin/bind8/resign.pl
#!/usr/bin/perl
open(CONF, "</etc/webmin/miniserv.conf") || die "Failed to open /etc/webmin/miniserv.conf : $!";
while(<CONF>) {
$root = $1 if (/^root=(.*)/);
}
close(CONF);
$root || die "No root= line found in /etc/webmin/miniserv.conf";
$ENV{'PERLLIB'} = "$root";
$ENV{'WEBMIN_CONFIG'} = "/etc/webmin";
$ENV{'WEBMIN_VAR'} = "/var/webmin";
delete($ENV{'MINISERV_CONFIG'});
chdir("$root/bind8");
exec("$root/bind8/resign.pl", @ARGV) || die "Failed to run $root/bind8/resign.pl : $!";
root@main:/etc/cron.daily#
I don’t know that you can get the system to recreate them at this point.
I don’t see anything in the Webmin backups that would make a backup of cron jobs. Etckeeper was installed on my system by default. Outside chance you have a backup without knowing it.
First up: Webmin Scheduled Functions are not system cron jobs. They run in the Webmin process, using Webmin’s own scheduled jobs system (which is kinda like cron, but simpler and embedded in Webmin itself, so it uses less resources). You should not expect to find Webmin Scheduled Functions in the system crontab.
The man has spoken.
Have it always been like that? My servers have been using webmin for 4 years, maybe older versions did register system crons? I do recall seeing something like collect.pl somewhere.
Anyway, its all good then. I also found out enabling monitoring in System and Server Status does write: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /etc/webmin/status/monitor.pl >/dev/null 2>&1
into the root cron, but that’s it.
Thanks for the clarification.
It has not always been like that. Webmin Scheduled Functions arrived a few years ago. It’s not generally something you need to manage directly (but there is visibility for them in the page you found).