| Server IP : 167.99.254.82 / Your IP : 216.73.216.188 Web Server : Apache System : Linux host.techisquad.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 User : pawluxera ( 1011) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/webmin/logrotate/ |
Upload File : |
#!/usr/bin/perl
# save_sched.cgi
# Create, update or delete the rotation cron job
require './logrotate-lib.pl';
&ReadParse();
&foreign_require("cron", "cron-lib.pl");
@jobs = &cron::list_cron_jobs();
if ($in{'idx'} ne "") {
$oldjob = $job = $jobs[$in{'idx'}];
}
else {
# Prefer the distro wrapper, when available, so future runs discover the
# then-current vendor and local drop-in set.
$job = { 'user' => 'root',
'command' => &get_scheduled_logrotate_command(),
'active' => 1 };
}
&lock_file(&cron::cron_file($job));
&error_setup($text{'sched_err'});
&cron::parse_times_input($job, \%in) if ($in{'sched'});
if ($oldjob && $in{'sched'}) {
# Just update
&cron::change_cron_job($job);
$action = "modify";
}
elsif ($oldjob && !$in{'sched'}) {
# Delete
&cron::delete_cron_job($job);
$action = "delete";
}
elsif (!$oldjob && $in{'sched'}) {
# Create new
&cron::create_cron_job($job);
$action = "create";
}
&unlock_file(&cron::cron_file($job));
&webmin_log($action, "sched");
&redirect("");