--- multicd Thu May 1 00:05:37 2003 +++ multicd_inc Tue Mar 16 14:24:58 2004 @@ -447,6 +447,14 @@ delete_tos(\@path, $config{image_mount}); next COPY_FILE; } + if ($config{since} != 0 && + ($type_mode & $TYPE_MASK) / ($MODE_MASK + 1) == $TYPE_FILE && + $config{since} > $mtime) { + # Skip this file if it is too old + warn "$oldfile is too old - $mtime - skipping\n"; + delete_tos(\@path, $config{image_mount}); + next COPY_FILE; + } $type = ($type_mode & $TYPE_MASK) / ($MODE_MASK + 1); $mode = ($type_mode & $MODE_MASK); $path[$#path]{type} = $type; @@ -782,7 +790,7 @@ cd_size fs_type files exclude cdrecord cd_done noburn image_dir image_dir2 first_disc addfiles cd_dev cd_mount mkfs_opts index_file help check_config maxfile_size - compress compress_level); + compress compress_level since); my @booleans = qw(multi only_one noburn first_disc addfiles help check_config); my @listvalues = qw(files exclude); @@ -946,6 +954,28 @@ } } + # Allow user to specify the 'since' time interval in + # days, hours, minutes and seconds + if(not defined($config_ref->{since})) { + $config_ref->{since} = 0; + } else { + my $time = 0; + while ($config_ref->{since} =~ /([\d\.]+)(\w){0,1}/ig) { + my $nb = $1; + my $unit = $2; + if ( lc($unit) eq "d" ) { + $time += int ( $nb * 24 * 60 * 60 ); + } elsif ( lc($unit) eq "h" ) { + $time += int ( $nb * 60 * 60 ); + } elsif ( lc($unit) eq "m" ) { + $time += int ( $nb * 60 ); + } elsif ( lc($unit) eq "s" | $unit =~ /\s*/ ) { + $time += int ( $nb * 60 * 60 ); + } + } + $config_ref->{since} = time() - $time; + } + # Compression # compress: 0 for none, 1 for gzip, 2 for bzip2, 3 for compress # compress_level: Defaults to 6 for gzip and compress, 9 for bzip2