[pve-devel] [PATCH 3/4] Disable job in cron on error

Wolfgang Link w.link at proxmox.com
Thu Jun 11 14:22:29 CEST 2015


Signed-off-by: Wolfgang Link <w.link at proxmox.com>
---
 pve-zsync | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pve-zsync b/pve-zsync
index cd2a228..b458826 100644
--- a/pve-zsync
+++ b/pve-zsync
@@ -362,7 +362,7 @@ sub format_job {
     my ($job, $line) = @_;
     my $text = "";
 
-    if ($job->{state} eq "stopped") {
+    if ($job->{state} eq "stopped" || $job->{state} eq "error") {
 	$text = "#";
     }
     if ($line) {
@@ -519,6 +519,7 @@ sub sync {
 	if(my $err = $@) {
 	    if ($job) {
 		$job->{state} = "error";
+		update_cron($job);
 		update_state($job);
 		unlock($lock_fh);
 		close($lock_fh);
@@ -1233,7 +1234,7 @@ add sync job from local VM to remote ZFS Server
 pve-zsync create -source=100 -dest=192.168.1.2:zfspool
 
 =head1 IMPORTANT FILES
- 
+
 Cron jobs are stored at                                 /etc/cron.d/pve-zsync
 
 The VM config get copied on the destination machine to  /var/pve-zsync/
-- 
2.1.4





More information about the pve-devel mailing list