Removed the french string in this english version.
[BackupPC.git] / bin / BackupPC_trashClean
1 #!/bin/perl -T
2 #============================================================= -*-perl-*-
3 #
4 # BackupPC_trashClean: remove all the files in $TopDir/trash.
5 #
6 # DESCRIPTION
7 #   BackupPC_trashClean is started once by BackupPC.  Every 5 minutes
8 #   it wakes up and removes all the files or directories in $TopDir/trash.
9 #   
10 # AUTHOR
11 #   Craig Barratt  <cbarratt@users.sourceforge.net>
12 #
13 # COPYRIGHT
14 #   Copyright (C) 2001  Craig Barratt
15 #
16 #   This program is free software; you can redistribute it and/or modify
17 #   it under the terms of the GNU General Public License as published by
18 #   the Free Software Foundation; either version 2 of the License, or
19 #   (at your option) any later version.
20 #
21 #   This program is distributed in the hope that it will be useful,
22 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
23 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 #   GNU General Public License for more details.
25 #
26 #   You should have received a copy of the GNU General Public License
27 #   along with this program; if not, write to the Free Software
28 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29 #
30 #========================================================================
31 #
32 # Version 1.6.0_CVS, released 10 Dec 2002.
33 #
34 # See http://backuppc.sourceforge.net.
35 #
36 #========================================================================
37
38 use strict;
39 use lib "/usr/local/BackupPC/lib";
40 use BackupPC::Lib;
41
42 die("BackupPC::Lib->new failed\n") if ( !(my $bpc = BackupPC::Lib->new) );
43 my $TopDir = $bpc->TopDir();
44 my $BinDir = $bpc->BinDir();
45 my %Conf   = $bpc->Conf();
46
47 $bpc->ChildInit();
48
49 ###########################################################################
50 # Empty trash every so often (eg: every 5 minutes)
51 ###########################################################################
52 while ( 1 ) {
53     print("processState running\n");
54     1 while ( $bpc->RmTreeTrashEmpty("$TopDir/trash") );
55     print("processState idle\n");
56     sleep($Conf{TrashCleanSleepSec} || 300);
57 }