}
sub get_files_recursively {
- my @dirs = @_;
- my @files = ns_system('./busybox', 'find', @dirs, '-type', 'f');
+ my ($dir, $includeempty) = @_;
+ my @extra_args = ();
+ if (!$includeempty) {
+ push @extra_args, '-size', '+0';
+ }
+
+ my @files = ns_system('./busybox', 'find', $dir, '-type', 'f', @extra_args);
map { chomp $_ } @files;
+
return @files;
}
push @binary_logfiles, $logfile;
}
}
+# Filter out some files
+@binary_logfiles = grep { ! ( m|/var/log/journal/.+\.journal| || # Binary journal files
+ # m|/var/log/journal/[0-9a-f]+/[a-z0-9-]+@[0-9a-f-]*\.journal| || # Rotated binary journal files
+ m|/var/log/.+\.\d\.[gx]z| # Rotated & compressed log files
+ ) } @binary_logfiles;
# These files will be sent once
send_file('/etc/crontab'); # Scheduled jobs