From cac0a07542fd88dfb4bff991e8fc9375dcaebf2f Mon Sep 17 00:00:00 2001 From: Stew Benedict Date: Tue, 27 Sep 2005 00:52:28 +0000 Subject: Avoid wiping out user cron --- perl-install/standalone/drakbackup | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'perl-install') 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 !/^#/; } -- cgit v1.2.1