Remove --unlink-first and --recursive-unlink from tar extract

What does this MR do and why?

Removes the --unlink-first and --recursive-unlink flags from the tar extract command used during backup restore. These flags cause restore to fail on RHEL/EL9+ systems where a patched GNU tar (RHSA-2026:0067) makes unlink(".") return EINVAL on the ./ root entry in backup archives.

The flags are redundant because the Rails restore path already moves all existing files to a timestamped backup directory via backup_existing_files_dir before tar extraction runs. Tar's default overwrite behavior is sufficient.

References

Closes #587492 (closed)

How to set up and validate locally

  1. Apply the changes and run the backup targets spec:
    bundle exec rspec spec/lib/backup/targets/files_spec.rb
  2. Verify all 28 examples pass with 0 failures.
  3. For end-to-end validation on a RHEL/EL9 system with patched tar (tar-1.34-9.el9_7 or later), run a full backup/restore cycle and confirm no Cannot unlink errors occur.

MR acceptance checklist

  • Tests added for new/changed behavior
  • All tests passing
  • Follows project style guide
  • No breaking changes introduced
  • Documentation updated (if applicable)

Merge request reports

Loading