diff options
author | Antoine Beaupré <anarcat@koumbit.org> | 2015-04-22 17:52:16 -0400 |
---|---|---|
committer | Antoine Beaupré <anarcat@koumbit.org> | 2015-04-22 17:58:26 -0400 |
commit | 6468c47980d81b345c069a7e87590d595ae08d70 (patch) | |
tree | 342b993dbc74e7ed4e4c1f439c1330ec05bfd2ee /files | |
parent | f234030025d20c80060308bd7ce5753dfcbac4e2 (diff) | |
download | puppet-backupninja-6468c47980d81b345c069a7e87590d595ae08d70.tar.gz puppet-backupninja-6468c47980d81b345c069a7e87590d595ae08d70.tar.bz2 |
always add the directory name to service
Diffstat (limited to 'files')
-rwxr-xr-x | files/checkbackups.pl | 10 |
1 files changed, 2 insertions, 8 deletions
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"; |