VOOZH about

URL: https://wiki.archlinux.org/title/Talk:Full_system_backup_with_tar

⇱ Talk:Full system backup with tar - ArchWiki


Jump to content
From ArchWiki
Latest comment: 20 April 2025 by Elizabeth in topic tar defaults for root and regular users

Serious flaw

Latest comment: 19 April 20171 comment1 person in discussion

tar -xattrs doesn't work: tar -xattrs (create then extract) isn't preserving extended attribute Ttoirrah (talk) 08:42, 19 April 2017 (UTC)

tar defaults for root and regular users

Latest comment: 20 April 20254 comments3 people in discussion

Some of the tar options mentioned in the article are default anyway, so specifying them seems redundant.

Current man pages (bsdtar being the one more detailed in this area) show:

  • --acls is the default behavior in c (create) mode for users, and is the default behavior for superuser in x (extract) mode
  • --xattrs is also default in c mode and default in x mode for root
  • -p is for x mode only and is used to restore permissions, attributes, ACLs; it's the default behavior for root; it can be partially overridden by --no-acls, --no-fflags, --no-mac-metadata, --no-xattrs which implies that the reverse equivalents of those are on by default

So, in essence, to create with autodetected (-a) modern compression method

(-v is separated here for visual clarity)

$ tar -v -caf backup.tzst /my/files

and to extract as root user to a specific destination directory path (note that the compression option need not be specified)

# bsdtar -xf backup.tzst -C /

or as unprivileged user (-p is necessary in this case to preserve extra file information)

$ bsdtar -xpf backup.tzst

Wizetek (talk) 13:29, 23 May 2024 (UTC)

I think the options can still be listed for educational purposes. Although, that could be done in a Note instead of appending the options to the command-line. -- Alad (talk) 16:26, 23 May 2024 (UTC)
I agree. Ideally I'd like to see the main command code simplified as much as possible without any extraneous options. Then follows a note which explains that the default invocation actually implies --acls --xattrs and that their application depends on tar operating mode based on user privilege level, and that -p applies only to extraction also based on user access level. Wizetek (talk) 18:50, 23 May 2024 (UTC)
I think that maybe if the note route is taken it could be a good idea to specify that older systems/versions of tar do not necessarily have it set. Thought anyone who uses an older system is likely to be aware of needing to check things like that. Still, it might be worth considering. Elizabeth (talk) 16:54, 20 April 2025 (UTC)

Incorrect use of bsdtar's -I flag under section 7

Latest comment: 20 April 20251 comment1 person in discussion

The command used under Backup with parallel compression:

# bsdtar -cvf /path/to/chosen/directory/etc-backup.tar.bz2 -I pbzip2 /etc

uses the -I option to specify the compression command to run (which is valid for regular tar). But under man bsdtar -I is described as a synonym for -T, which is described under -T as used to read filenames from a file.

Instead, --use-compress-program, which exists in regular tar too, should be used. Elizabeth (talk) 16:39, 20 April 2025 (UTC)