From f06c336b2a3fd5f97a95cc48e9fe6b62d46e7e8f Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Thu, 17 Dec 2020 15:17:37 +0100 Subject: [PATCH 1/1] remove unused function write_cron Commit 76b2c677f7a2fd81a990533b317374d168d1d918 replaced it with update_cron. Signed-off-by: Fabian Ebner --- pve-zsync | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/pve-zsync b/pve-zsync index f3b98c4..881b9c8 100755 --- a/pve-zsync +++ b/pve-zsync @@ -757,42 +757,6 @@ sub snapshot_add { } } -sub write_cron { - my ($cfg) = @_; - - my $text = "SHELL=/bin/sh\n"; - $text .= "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n"; - - my $fh = IO::File->new("> $CRONJOBS"); - die "Could not open file: $!\n" if !$fh; - - foreach my $source (sort keys%{$cfg}) { - foreach my $sync_name (sort keys%{$cfg->{$source}}) { - next if $cfg->{$source}->{$sync_name}->{status} ne 'ok'; - $text .= "$PROG_PATH sync"; - $text .= " -source "; - if ($cfg->{$source}->{$sync_name}->{vmid}) { - $text .= "$cfg->{$source}->{$sync_name}->{source_ip}:" if $cfg->{$source}->{$sync_name}->{source_ip}; - $text .= "$cfg->{$source}->{$sync_name}->{vmid} "; - } else { - $text .= "$cfg->{$source}->{$sync_name}->{source_ip}:" if $cfg->{$source}->{$sync_name}->{source_ip}; - $text .= "$cfg->{$source}->{$sync_name}->{source_pool}"; - $text .= "$cfg->{$source}->{$sync_name}->{source_path}" if $cfg->{$source}->{$sync_name}->{source_path}; - } - $text .= " -dest "; - $text .= "$cfg->{$source}->{$sync_name}->{dest_ip}:" if $cfg->{$source}->{$sync_name}->{dest_ip}; - $text .= "$cfg->{$source}->{$sync_name}->{dest_pool}"; - $text .= "$cfg->{$source}->{$sync_name}->{dest_path}" if $cfg->{$source}->{$sync_name}->{dest_path}; - $text .= " -name $sync_name "; - $text .= " -limit $cfg->{$source}->{$sync_name}->{limit}" if $cfg->{$source}->{$sync_name}->{limit}; - $text .= " -maxsnap $cfg->{$source}->{$sync_name}->{maxsnap}" if $cfg->{$source}->{$sync_name}->{maxsnap}; - $text .= "\n"; - } - } - die "Can't write to cron\n" if (!print($fh $text)); - close($fh); -} - sub get_disks { my ($target, $user) = @_; -- 2.39.2