Added a warning if % is used in filenames but strftime substition is not enabled.
---- Changes since 1.330 ----
Added tabs to reduce the size of the main page.
+---- Changes since 1.390 ----
+When a directory is entered as an additional path to backup, it will be expanded to the list of all files under it when the backup is done.
# Add other files
foreach my $f (@{$_[6]}) {
- push(@files, $f);
- push(@{$manifestfiles{"other"}}, $f);
+ if (-d $f) {
+ # A directory .. recursively expand
+ foreach my $sf (&expand_directory($f)) {
+ push(@files, $sf);
+ push(@{$manifestfiles{"other"}}, $sf);
+ }
+ }
+ else {
+ # Just one file
+ push(@files, $f);
+ push(@{$manifestfiles{"other"}}, $f);
+ }
}
# Save the manifest files
return ($webmin, $nofiles, $others);
}
+sub expand_directory
+{
+local ($dir) = @_;
+local @rv;
+opendir(EXPAND, $dir);
+local @sf = readdir(EXPAND);
+closedir(EXPAND);
+foreach my $sf (@sf) {
+ next if ($sf eq "." || $sf eq "..");
+ local $path = "$dir/$sf";
+ if (-l $path || !-d $path) {
+ push(@rv, $path);
+ }
+ elsif (-d $sf) {
+ push(@rv, &expand_directory($path));
+ }
+ }
+return @rv;
+}
+
1;