1

User:- Root

/usr/bin/rsync -hprltaq --include '*/' --include '*.gz' --exclude '*' "/var/cache/backup/backup-20210817mysql.tar.gz" <storage_IP>::my-app/backup/sql_backup/

error:-->

rsync: chgrp "/backup/sql_backup/.backup-20210817mysql.tar.gz.nWPkhd" (in my-app) failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]

even though rsync is throwing error the file is being copied to the destination(storage server).

permission on the storage server

ls -al backup/
drwxr-xr-x  9 nobody nogroup  4096 Oct  3  2020 .
drwxr-xr-x 81 nobody nogroup 12288 Aug 17 08:00 ..
drwxrwxrwx  2 nobody nogroup 4.0K Aug 17 12:54 sql_backup

I have also tried 777 permission but getting the same error.

0

1 Answer 1

0

The -a (--archive) flag you specified to rsync includes the request to set owner and group for the destination files/directories to those of the source items. It seems likely that the storage server is not running the rsync service as root, and the user under which it is running is not a member of the group that owns the source file /var/cache/backup/backup-20210817mysql.tar.gz.

There are three possible solutions that I can see,

  1. Test if the storage server has extended attributes available in its filing system, and if so then use them to store owner/group and other useful metadata

     rsync -M--fake-super --numeric-ids -ahq ...
    

    This would be the best solution. To save and restore files, always include -M--fake-super--numeric-ids.

  2. Remove owner/group identity from the metadata written to the storage server. You would then be responsible for restoring this "manually"

     rsync -ahq --no-o --no-g ...
    
  3. Run the service on the storage system as root. This presupposes a Linux/UNIX-based operating system, that you can change the service owner, and that you are happy with the risks. Not recommended, but just listed as a possibility.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .