my $cpuinfo= PVE::ProcFSTools::read_cpuinfo();
+our $COMMON_TAR_FLAGS = [ '--totals', '--sparse', '--numeric-owner', '--acls',
+ '--xattrs',
+ '--xattrs-include=user.*',
+ '--xattrs-include=security.capability' ];
+
cfs_register_file('/lxc/', \&parse_pct_config, \&write_pct_config);
my $rootfs_desc = {
# PVE::Tools::run_command(['chown', '-R', '100000:100000', $rootdir]);
# }
- my $cmd = [@$userns_cmd, 'tar', 'xpf', $archive, '--numeric-owner', '--totals',
- '--sparse', '-C', $rootdir];
+ my $cmd = [@$userns_cmd, 'tar', 'xpf', $archive, '--totals',
+ @$PVE::LXC::COMMON_TAR_FLAGS,
+ '-C', $rootdir];
# skip-old-files doesn't have anything to do with time (old/new), but is
# simply -k (annoyingly also called --keep-old-files) without the 'treat
my $opts = $self->{vzdump}->{opts};
- my $rsync = ['rsync', '--stats', '-X', '--numeric-ids',
+ my $rsync = ['rsync', '--stats', '-X', '-A', '--numeric-ids',
'-aH', '--delete', '--no-whole-file', '--inplace',
'--one-file-system', '--relative'];
push @$rsync, "--bwlimit=$opts->{bwlimit}" if $opts->{bwlimit};
my $snapdir = $task->{snapdir};
my $tmpdir = $task->{tmpdir};
- my $tar = ['tar', 'cpf', '-',
- '--totals', '--sparse', '--numeric-owner', '--xattrs',
+ my $tar = ['tar', 'cpf', '-', '--totals',
+ @$PVE::LXC::COMMON_TAR_FLAGS,
'--one-file-system', '--warning=no-file-ignored'];
# note: --remove-files does not work because we do not