From 6468c47980d81b345c069a7e87590d595ae08d70 Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Wed, 22 Apr 2015 17:52:16 -0400 Subject: always add the directory name to service --- files/checkbackups.pl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'files') diff --git a/files/checkbackups.pl b/files/checkbackups.pl index 0ea4805..8cef408 100755 --- a/files/checkbackups.pl +++ b/files/checkbackups.pl @@ -76,14 +76,8 @@ sub check_rdiff { } close(FLAG); ($state, $delta) = check_age($last_bak); - $dir =~ /([^\/]*)\/rdiff-backup/; - if ($1 ne $host) { - # special subdir backup - $service = "backups-$1"; - } - else { - $service = 'backups'; - } + $dir =~ /([^\/]+)\/?$/; + $service = "backups-$1"; print_status($host, $state, "$delta hours old$extra_msg", $service); foreach my $vserver_dir (@vserver_dirs) { $vsdir = "$dir/$vserver_dir"; -- cgit v1.2.3