Skip to content

Commit

Permalink
Filip's hourly at most option
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Sep 26, 2007
1 parent 38660e7 commit 3d2487a
Show file tree
Hide file tree
Showing 35 changed files with 42 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cron/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions cron/config-aix
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-cobalt-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-coherent-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-corel-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-debian-linux
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-debian-linux-2.1-*
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-generic-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-gentoo-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-hpux
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-irix
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-macos
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-mandrake-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-msc-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-netbsd
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-open-linux
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-openbsd
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-openmamba-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-openserver
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-osf1
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-redhat-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-slackware-linux
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-sol-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-solaris
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-suse-linux
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-suse-linux-7.0-8.0
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-suse-linux-8.2-*
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-trustix-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-turbo-linux
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-united-linux
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-unixware
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ match_mode=0
match_user=1
kill_subs=0
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config-windows
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ match_user=1
kill_subs=0
single_file=c:/cronw/crontab.txt
show_comment=0
hourly_only=0
1 change: 1 addition & 0 deletions cron/config.info
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ show_run=Display running status of jobs?,1,2-Yes, 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
Expand Down
12 changes: 7 additions & 5 deletions cron/cron-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -688,17 +688,19 @@ sub show_times_input

# 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; }
Expand Down

0 comments on commit 3d2487a

Please sign in to comment.