public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 zsync 1/3] remove unused function write_cron
@ 2020-12-17 14:17 Fabian Ebner
  2020-12-17 14:17 ` [pve-devel] [PATCH v2 zsync 2/3] introduce and use read_file helper Fabian Ebner
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Fabian Ebner @ 2020-12-17 14:17 UTC (permalink / raw)
  To: pve-devel

Commit 76b2c677f7a2fd81a990533b317374d168d1d918 replaced it with
update_cron.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

New in v2 and not related to the rest of the series.

 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.20.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-18 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 14:17 [pve-devel] [PATCH v2 zsync 1/3] remove unused function write_cron Fabian Ebner
2020-12-17 14:17 ` [pve-devel] [PATCH v2 zsync 2/3] introduce and use read_file helper Fabian Ebner
2020-12-18 16:44   ` Thomas Lamprecht
2020-12-17 14:17 ` [pve-devel] [PATCH v2 zsync 3/3] fix #2821: only abort if there really is a waiting/syncing job Fabian Ebner
2020-12-18 16:43 ` [pve-devel] applied-series: Re: [PATCH v2 zsync 1/3] remove unused function write_cron Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal