restic icon indicating copy to clipboard operation
restic copied to clipboard

no support for linux inode flags

Open Framsfex opened this issue 2 years ago • 10 comments

Output of restic version

restic 0.14.0 compiled with go1.19 on linux/amd64

How did you run restic exactly?

root@obertux:/backup/tmp# isodate > zzz root@obertux:/backup/tmp# chattr +a zzz

root@obertux:/backup/tmp# restic --verbose backup /backup open repository repository e4632814 opened (repository version 2) successfully, password is correct lock repository using parent snapshot 109cd1be load index files start scan on [/backup] start backup on [/backup] scan finished in 0.342s: 738 files, 28.426 GiB

Files: 0 new, 1 changed, 737 unmodified Dirs: 0 new, 83 changed, 20 unmodified Data Blobs: 0 new Tree Blobs: 29 new Added to the repository: 594.240 KiB (277.309 KiB stored)

processed 738 files, 28.426 GiB in 0:01 snapshot a7616eda saved

root@obertux:/backup/tmp# restic restore -v -t . -i /backup/tmp latest repository e4632814 opened (repository version 2) successfully, password is correct restoring <Snapshot 9d87312c of [/backup] at 2022-12-08 16:07:30.190920159 +0100 CET by root@obertux> to .

root@obertux:/backup/tmp# ll -R drwxr-xr-x root root - 2019-11-08 14:38:49 backup drwxr-xr-x root root - 2022-12-08 16:09:48 backup/tmp -rw-rw-r-- root root 20 2022-12-08 15:43:22 backup/tmp/zzz -rw-rw-r-- root root 20 2022-12-08 15:43:22 zzz

root@obertux:/backup/tmp# lsattr zzz backup/tmp/zzz -----a-------------- zzz -------------------- backup/tmp/zzz

What backend/server/service did you use to store the repository?

Our own S3 compatible Netapp storage with: export RESTIC_REPOSITORY=s3:s3.tik.uni-stuttgart.de/restic export RESTIC_PASSWORD_FILE=/root/.restic-password

Expected behavior

The restored file backup/tmp/zzz should have the same attributes as the original one. restic ignores the extended file attributes (see output of lsattr above)

Actual behavior

root@obertux:/backup/tmp# lsattr zzz backup/tmp/zzz -----a-------------- zzz -------------------- backup/tmp/zzz

Steps to reproduce the behavior

see above

Do you have any idea what may have caused this?

Missing extended file attributes support, at least on S3 storage.

Do you have an idea how to solve the issue?

Did restic help you today? Did it make you happy in any way?

restic is fast and has an easy usage, ACLs and Posix file capabilities are supported.

Framsfex avatar Dec 08 '22 16:12 Framsfex

Meanwhile I have written a bash wrapper for restic which saves chattr attributes in a special .chattr file which is included in the snapshot. For restore I have written restic-restore which uses this file to restore the missing attributes. Of course this is a workaround, native restic chattr support would be MUCH better.

Framsfex avatar Feb 23 '23 17:02 Framsfex

I have written a bash wrapper for restic which saves chattr attributes in a special .chattr file which is included in the snapshot. For restore I have written restic-restore which uses this file to restore the missing attributes.

Nice work! Would you mind sharing these?

dodedodo avatar Feb 23 '23 18:02 dodedodo

All coding I do is free software :-)

But as I wrote: it is only a workaround, not a real (good) solution.

Hmm... attaching here failed, I use my own server:

https://fex.rus.uni-stuttgart.de/fop/KVPVv8wM/restic_extra.zip

Framsfex avatar Feb 23 '23 18:02 Framsfex

Meanwhile I run restic 0.15.1: still no native chattr support...

Framsfex avatar Feb 25 '23 14:02 Framsfex

restic 0.16.4 : no chattr support :-(

Framsfex avatar May 12 '24 07:05 Framsfex

Sorry that it doesn't have it, and if that frustrates you, but repeating the same thing again and in a way that can come across as negative and somewhat demanding will not help to encourage developers to make it happen ;)

rawtaz avatar May 12 '24 16:05 rawtaz

I wrote my reply comment because it is a year and some versions later. How can I encourage the developers?

Framsfex avatar May 12 '24 17:05 Framsfex

Please see the restic roadmap at https://forum.restic.net/t/roadmap-for-restic-0-17-to-0-19 and also the activity in the restic repository. You will see that work is going on with other and larger refactoring as well as features. When time permits, someone will look at this specific issue. Repeating what has already been indicated in this issue does not add more than noise, which just takes more of the developers time that they could otherwise focus on doing actual work :)

rawtaz avatar May 12 '24 18:05 rawtaz

Changed the title to match the name from the corresponding man page: https://manpages.ubuntu.com/manpages/bionic/man2/ioctl_iflags.2.html .

MichaelEischer avatar Jul 04 '24 18:07 MichaelEischer

If someone is interested in implementing this feature, feel free to add a new GenericAttributeType for the restic.Node datatype. Oh, and please check whether it might make sense to be compatible with chflags from the BSD world.

MichaelEischer avatar Jul 04 '24 18:07 MichaelEischer