Filip's hourly at most option
authorJamie Cameron <jcameron@webmin.com>
Wed, 26 Sep 2007 18:30:48 +0000 (18:30 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 26 Sep 2007 18:30:48 +0000 (18:30 +0000)
35 files changed:
cron/CHANGELOG
cron/config-aix
cron/config-cobalt-linux
cron/config-coherent-linux
cron/config-corel-linux
cron/config-debian-linux
cron/config-debian-linux-2.1-*
cron/config-freebsd
cron/config-generic-linux
cron/config-gentoo-linux
cron/config-hpux
cron/config-irix
cron/config-macos
cron/config-mandrake-linux
cron/config-msc-linux
cron/config-netbsd
cron/config-open-linux
cron/config-openbsd
cron/config-openmamba-linux
cron/config-openserver
cron/config-osf1
cron/config-redhat-linux
cron/config-slackware-linux
cron/config-sol-linux
cron/config-solaris
cron/config-suse-linux
cron/config-suse-linux-7.0-8.0
cron/config-suse-linux-8.2-*
cron/config-trustix-linux
cron/config-turbo-linux
cron/config-united-linux
cron/config-unixware
cron/config-windows
cron/config.info
cron/cron-lib.pl

index dd73ab5..1802ae8 100644 (file)
@@ -19,3 +19,5 @@ Changed the default schedule for new jobs to hourly.
 When a user's home directory is changed in the Users and Groups module, any Cron jobs that use the old path are updated to the new.
 ---- Changes since 1.350 ----
 Added a button on the Edit Job page for cloning an existing job.
+---- Changes since 1.360 ----
+Added a Module Config option to limit Cron jobs to hourly at most, thanks to Filip Hajny.
index 574a692..850334c 100644 (file)
@@ -17,3 +17,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 33e1543..661bdba 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 33e1543..661bdba 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index ac11abe..a602d7f 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 22f203b..3e1ae2d 100644 (file)
@@ -18,3 +18,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 78aeac4..31f8967 100644 (file)
@@ -21,3 +21,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index abd294c..ad073f4 100644 (file)
@@ -18,3 +18,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 33e1543..661bdba 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 4383e60..dea2c5f 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 76b3f7f..87f2943 100644 (file)
@@ -17,3 +17,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 565e33b..9541e39 100644 (file)
@@ -19,3 +19,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 58045df..e7efe3c 100644 (file)
@@ -18,3 +18,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 33e1543..661bdba 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 33e1543..661bdba 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index abd294c..ad073f4 100644 (file)
@@ -18,3 +18,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 2781325..ac15684 100644 (file)
@@ -21,3 +21,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index abd294c..ad073f4 100644 (file)
@@ -18,3 +18,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 33e1543..661bdba 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 27b000f..dd07fd8 100644 (file)
@@ -17,3 +17,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index dab27af..f7f7ce7 100644 (file)
@@ -19,3 +19,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 33e1543..661bdba 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index d469235..c01eb78 100644 (file)
@@ -17,3 +17,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 077fd42..11897f4 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 564070b..ee71126 100644 (file)
@@ -17,3 +17,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 1a02ac8..d392fae 100644 (file)
@@ -19,3 +19,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index b73f46b..19607d6 100644 (file)
@@ -19,3 +19,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 208abda..fdfe162 100644 (file)
@@ -19,3 +19,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index c4d4dd2..8add911 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 33e1543..661bdba 100644 (file)
@@ -20,3 +20,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 208abda..fdfe162 100644 (file)
@@ -19,3 +19,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index 564070b..ee71126 100644 (file)
@@ -17,3 +17,4 @@ match_mode=0
 match_user=1
 kill_subs=0
 show_comment=0
+hourly_only=0
index f695553..effd0fc 100644 (file)
@@ -9,3 +9,4 @@ match_user=1
 kill_subs=0
 single_file=c:/cronw/crontab.txt
 show_comment=0
+hourly_only=0
index 122b00b..2dcf532 100644 (file)
@@ -6,6 +6,7 @@ show_run=Display running status of jobs?,1,2-Yes&#44; and allow starting and sto
 match_mode=Find job processes by,1,1-Command only,0-Command and arguments
 match_user=Match usernames when finding job processes?,1,1-Yes,0-No
 kill_subs=Kill sub-processes when terminating jobs?,1,1-Yes,0-No
+hourly_only=Only allow jobs to be at most hourly?,1,0-No,1-Yes
 line2=System configuration,11
 cron_dir=Crontab Directory,0
 cron_get_command=Command to read a user's cron job,0
index f107139..4091f4e 100644 (file)
@@ -688,17 +688,19 @@ foreach $arr ("mins", "hours", "days", "months", "weekdays") {
 
        # Output selection list
        print "<td valign=top>\n";
-       printf "<input type=radio name=all_$arr value=1 %s> $text{'edit_all'}<br>\n",
+        printf "<input type=radio name=all_$arr value=1 %s %s> $text{'edit_all'}<br>\n",
+                $arr eq "mins" && $config{'hourly_only'} ? "disabled" : "",
                $job->{$arr} eq "*" ? "checked" : "";
        printf "<input type=radio name=all_$arr value=0 %s> $text{'edit_selected'}<br>\n",
                $job->{$arr} ne "*" ? "checked" : "";
        print "<table> <tr>\n";
-       for($j=0; $j<@$arr; $j+=12) {
-               $jj = $j+11;
+        for($j=0; $j<@$arr; $j+=($arr eq "mins" && $config{'hourly_only'} ? 60 : 12)) {
+                $jj = $j+($arr eq "mins" && $config{'hourly_only'} ? 59 : 11);
                if ($jj >= @$arr) { $jj = @$arr - 1; }
                @sec = @$arr[$j .. $jj];
-               printf "<td valign=top><select multiple size=%d name=$arr>\n",
-                       @sec > 12 ? 12 : scalar(@sec);
+                printf "<td valign=top><select %s size=%d name=$arr>\n",
+                        $arr eq "mins" && $config{'hourly_only'} ? "" : "multiple",
+                        @sec > 12 ? ($arr eq "mins" && $config{'hourly_only'} ? 1 : 12) : scalar(@sec);
                foreach $v (@sec) {
                        if ($v =~ /^(.*)=(.*)$/) { $disp = $1; $code = $2; }
                        else { $disp = $code = $v; }