Files and directories to exclude can be specified for TAR format backups on Linux.
---- Changes since 1.410 ----
Added checkboxes to control if failure of the pre and post-backup commands cause the whole job to be regarded as a failure.
+Prevent non-level-0 backups and updating of the /etc/dumpdates file for backups of directories that are not filesystem mount points, as this isn't supported by the <tt>dump</tt> command.
sub directory_filesystem
{
local $fs;
-foreach $m (sort { length($a->[0]) <=> length($b->[0]) }
- &foreign_call("mount", "list_mounted")) {
+foreach my $m (sort { length($a->[0]) <=> length($b->[0]) }
+ &mount::list_mounted()) {
local $l = length($m->[0]);
if ($m->[0] eq $_[0] || $m->[0] eq "/" ||
(length($_[0]) >= $l && substr($_[0], 0, $l+1) eq $m->[0]."/")) {
return wantarray ? @$fs : $fs->[2];
}
+# is_mount_point(dir)
+# Returns 1 if some directory is a filesystem mount point
+sub is_mount_point
+{
+local ($dir) = @_;
+foreach my $m (&mount::list_mounted()) {
+ return 1 if ($m->[0] eq $dir);
+ }
+return 0;
+}
+
# same_filesystem(fs1, fs2)
# Returns 1 if type filesystem types are the same
sub same_filesystem
only files that are new or modified since the last dump of a lower level will
be written. <p>
+When backing up a directory that is not a filesystem mount point, the only
+level that can be selected in 0. <p>
+
<hr>
<header>Update /etc/dumpdates file?</header>
-When this option is enabled, the date, time, source and destination of the backup
-will be recorded in human-readable form in <tt>/etc/dumpdates</tt>. <p>
+This option can only be enabled when backing up an entire filesystem. When enabled, the source filesystem device name, level, date and time of the backup will be recorded in human-readable form in <tt>/etc/dumpdates</tt>. There may be only one entry per filesystem at each level. This option is useful when using the <tt>dump -W</tt> command-line option to display the most recent dump date and level of each filesystem.<p>
<hr>
if ($_[0]->{'fs'} eq 'xfs') {
# Parse xfs options
- local $mp;
- foreach $m (&foreign_call("mount", "list_mounted")) {
- $mp++ if ($m->[0] eq $in{'dir'});
- }
- $mp || &error($text{'dump_emp'});
+ &is_mount_point($in{'dir'}) || &error($text{'dump_emp'});
$in{'label'} =~ /^\S*$/ && length($in{'label'}) < 256 ||
&error($text{'dump_elabel2'});
$_[0]->{'label'} = $in{'label'};
dump_file=File or tape device
dump_host=Host $1 as user $2 in file or device $3
dump_level=Dump level
-dump_level_0=(Full backup)
+dump_level_0=0 (Full backup)
dump_label=Backup label
dump_multi=Split across multiple files?
dump_update=Update <tt>/etc/dumpdates</tt> file?
dump_reverify=Attempt test restore after backup to verify?
dump_remount=Remount with <tt>noatime</tt> option during backup?
dump_eftpupdate=Adding files to an existing archive is not possible when using FTP.
+dump_eleveldir=Only level 0 backups are allowed for directories that are not filesystem mount points
+dump_eupdatedir=The <tt>/etc/dumpdates</tt> file can only be updated for directories that are filesystem mount points
edit_err=Failed to create backup
edit_edir=Missing backup directory
}
elsif ($_[0]->{'fs'} eq 'xfs') {
# Parse xfs options
- local $mp;
- foreach $m (&foreign_call("mount", "list_mounted")) {
- $mp++ if ($m->[0] eq $in{'dir'});
- }
- $mp || &error($text{'dump_emp'});
+ &is_mount_point($in{'dir'}) || &error($text{'dump_emp'});
$in{'label'} =~ /^\S*$/ && length($in{'label'}) < 256 ||
&error($text{'dump_elabel2'});
$_[0]->{'label'} = $in{'label'};
}
}
else {
- # Parse ext2/3 options
+ # Parse ext2/3 dump options
$_[0]->{'rsh'} = &rsh_command_parse("rsh_def", "rsh");
$_[0]->{'pass'} = $in{'pass'};
+ if ($in{'update'}) {
+ &is_mount_point($in{'dir'}) || &error($text{'dump_eupdatedir'});
+ }
$_[0]->{'update'} = $in{'update'};
$_[0]->{'multi'} = $in{'multi'};
+ if ($in{'level'} > 0) {
+ &is_mount_point($in{'dir'}) || &error($text{'dump_eleveldir'});
+ }
$_[0]->{'level'} = $in{'level'};
$in{'label'} =~ /^\S*$/ && length($in{'label'}) < 16 ||
&error($text{'dump_elabel'});