summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStew Benedict <stewb@mandriva.org>2005-09-27 00:52:28 +0000
committerStew Benedict <stewb@mandriva.org>2005-09-27 00:52:28 +0000
commitcac0a07542fd88dfb4bff991e8fc9375dcaebf2f (patch)
tree556b19dcb483f279a44a78121884117dd9738ef4
parent7b76f99a7f79863741115185ba10b2c3a9858782 (diff)
downloaddrakx-cac0a07542fd88dfb4bff991e8fc9375dcaebf2f.tar
drakx-cac0a07542fd88dfb4bff991e8fc9375dcaebf2f.tar.gz
drakx-cac0a07542fd88dfb4bff991e8fc9375dcaebf2f.tar.bz2
drakx-cac0a07542fd88dfb4bff991e8fc9375dcaebf2f.tar.xz
drakx-cac0a07542fd88dfb4bff991e8fc9375dcaebf2f.zip
Avoid wiping out user cron
-rwxr-xr-xperl-install/standalone/drakbackup11
1 files changed, 8 insertions, 3 deletions
diff --git a/perl-install/standalone/drakbackup b/perl-install/standalone/drakbackup
index f10959287..9b996620c 100755
--- a/perl-install/standalone/drakbackup
+++ b/perl-install/standalone/drakbackup
@@ -373,12 +373,16 @@ sub read_cron_files() {
}
}
if ($conf{DAEMON_TIME_SPACE} ne "custom") {
- !$daemon_found and $backup_daemon = 0;
+ !$daemon_found and $backup_daemon = 0;
} else {
+ read_user_cron();
+ }
+}
+
+sub read_user_cron() {
$custom_cron = 1;
@cron_entries = `crontab -l`;
chomp @cron_entries;
- }
}
sub save_cron_files() {
@@ -401,7 +405,7 @@ sub save_cron_files() {
system("chmod +x /etc/cron.$conf{DAEMON_TIME_SPACE}/drakbackup");
}
- if ($conf{DAEMON_TIME_SPACE} eq "custom" || !$backup_daemon) {
+ if ($conf{DAEMON_TIME_SPACE} eq "custom" && $backup_daemon) {
foreach (@cron_entries) {
next if /^#/;
push @cron_output, $_ . "\n";
@@ -2096,6 +2100,7 @@ sub advanced_when() {
my $cron_iter;
my $cron_entry;
+ read_user_cron();
foreach (@cron_entries) {
$cron_model->append_set(0, $_) if !/^#/;
}