(This is on MacOS Monterey)
When performing a backup using rsync --delete ....
to a USB stick, I noticed that there was a file which rsync could not delete, with error message Operation not permitted. I could verify this when I did manually a rm -f ...
of this file. Checking the permissions of the file using stat
, I see
16777231 936844 -rwxrwxrwx 1 ronaldfischer staff 0 692785057 "Mar 28 09:40:06 2023" "Sep 28 14:41:38 2020" "Sep 28 14:41:38 2020" "Nov 11 10:54:25 2022" 131072 1353216 0x2 /Volumes/SANKESU/gitwrk/vp5-e/.git/modules/repository/objects/pack/pack-f9012a97f8775c87b9d24fc0b4c276b883a6eb6a.pack
and checking the permissions on the directory which holds this file, I see
16777231 1125079 drwxrwxrwx 1 ronaldfischer staff 0 131072 "Nov 11 10:54:10 2022" "Apr 11 15:44:46 2023" "Apr 11 15:44:46 2023" "Nov 11 10:54:11 2022" 131072 256 0 /Volumes/SANKESU/gitwrk/vp5-e/.git/modules/repository/objects/pack
It does not look like a permission problem. What could be the reason?
BTW, from the time stamp given in the stat command, I can conclude that both directory and file had been created by a rsync
running on Windows/Cygwin, but I don't see how this would explain the error message.
Other files in the backup of my repo are deleted without problems by rsync. Problems seem to occur only in entries which are located below .git/objects
. I am aware that when doing the backup, there is no real need to backup the directory .git
as well (except that when doing it, I can cd
into the backup of my repository and perform git
commands), but still I would like to know the reason for this problem.