This one is still a little too hard to get my head around.
I've got a root script which (depending on a certain condition) decides whether or not to call a backup script.
This backup script needs to run with user privileges, and not with root privileges. The backup script will call the rsync deamon and will write files to the users backup directory. So the owner of the backup directory will be the one that calls the backup script with his/her user privileges.
The root script does a chown of backup directory and then I execute a su to the correct user just before executing the backup script.
I've been experimenting with chown but that does not allow the back up script to delete or add stuff.
Simply said, I don't know which commands to run to accomplish this task.
Any help is more than welcome