From: martin@piware.de <> Date: Mon, 2 Nov 2009 11:47:31 +0000 (+0100) Subject: drop backup-getfiles, using .rsync-filter now X-Git-Url: https://piware.de/gitweb/?p=bin.git;a=commitdiff_plain;h=ab6305117fac1c8f7a08f2d3ea8ef206963d0031 drop backup-getfiles, using .rsync-filter now --- diff --git a/backup-getfiles b/backup-getfiles deleted file mode 100755 index f0c418d..0000000 --- a/backup-getfiles +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/perl - -# (c) 2002 Martin Pitt (martin@piware.de) -# This software is protected by the terms and conditions of the GNU -# General Public License (see http://www.gnu.org/copyleft/gpl.html for -# details). - -use Getopt::Std; - -# filelist( $d ) -# generate a recursive list of files in $d; honors per-directory -# configuration files .pibackuprc -sub filelist { - my $d = shift; - $d .= '/' if ( substr( $d, -1 ) ne '/' ); - - # look for exclude file - my @excl; - if( -r $d.'.pibackuprc' ) { - open( EXCL, $d.'.pibackuprc' ) or die "Error: could not open $d.pibackuprc"; - while( ) { - chomp; - push @excl, glob $d.$_; - } - close EXCL; - } - - # open and traverse dir - local *DIR; - opendir( DIR, $d ) or print STDERR "Could not open directory $d\n" && return; - -FILE: - while( defined( $f = readdir DIR ) ) { - next if $f eq '.' || $f eq '..'; - - foreach ( @excl ) { next FILE if $d.$f eq $_; } - - if( !( -l $d.$f ) && -d _ ) { - filelist( $d.$f ); - } else { - if( !$newer || ( ( lstat _ )[9] >= $newer ) ) { - print "$d$f$term"; - } - } - } - closedir DIR; -} - -getopts( '0n:' ); - -if( $opt_n ) { - $newer = ( lstat $opt_n )[9]; # mtime -} - -$term = $opt_0 ? "\0" : "\n"; - -$dir = $ARGV[0] || $ENV{'HOME'} || '/'; -foreach (glob $dir) { - if (-d $_) { - filelist $_; - } else { - print "$_$term"; - } -}