added common BackupPC::Search::host_backup_nums
[BackupPC.git] / bin / BackupPC_trashClean
index edea64c..28adf70 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/perl -T
+#!/usr/bin/perl
 #============================================================= -*-perl-*-
 #
 # BackupPC_trashClean: remove all the files in $TopDir/trash.
@@ -11,7 +11,7 @@
 #   Craig Barratt  <cbarratt@users.sourceforge.net>
 #
 # COPYRIGHT
-#   Copyright (C) 2001  Craig Barratt
+#   Copyright (C) 2001-2009  Craig Barratt
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #
 #========================================================================
 #
-# Version 2.0.0beta1, released 30 Mar 2003.
+# Version 3.2.0, released 31 Jul 2010.
 #
 # See http://backuppc.sourceforge.net.
 #
 #========================================================================
 
 use strict;
+no  utf8;
 use lib "/usr/local/BackupPC/lib";
 use BackupPC::Lib;
 
@@ -51,7 +52,9 @@ $bpc->ChildInit();
 ###########################################################################
 while ( 1 ) {
     print("processState running\n");
-    1 while ( $bpc->RmTreeTrashEmpty("$TopDir/trash") );
+    if ( $bpc->RmTreeTrashEmpty("$TopDir/trash") < 0 ) {
+       print("log BackupPC_trashClean failed to empty $TopDir/trash\n");
+    }
     print("processState idle\n");
     sleep($Conf{TrashCleanSleepSec} || 300);
 }