X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_trashClean;h=80bcee3cb1f6e1cdb3cef8f7cc586160099e7190;hp=d266327291f0c47c139d99ecfca6838d28c4052c;hb=fda25dc88a63ccac1c80efa2e4994bf0725ca9b7;hpb=1ce7d1541ea1279aaa0a75c16986a3fd40b608ec diff --git a/bin/BackupPC_trashClean b/bin/BackupPC_trashClean index d266327..80bcee3 100755 --- a/bin/BackupPC_trashClean +++ b/bin/BackupPC_trashClean @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC_trashClean: remove all the files in $TopDir/trash. @@ -11,7 +11,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001 Craig Barratt +# Copyright (C) 2001-2007 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 @@ -29,14 +29,15 @@ # #======================================================================== # -# Version 1.5.0, released 2 Aug 2002. +# Version 3.1.0, released 25 Nov 2007. # # See http://backuppc.sourceforge.net. # #======================================================================== use strict; -use lib "__INSTALLDIR__/lib"; +no utf8; +use lib "/usr/local/BackupPC/lib"; use BackupPC::Lib; die("BackupPC::Lib->new failed\n") if ( !(my $bpc = BackupPC::Lib->new) ); @@ -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); }