I am currently writing a bash shell script to port the latest version of our svn repository to a web server. This is done by exporting svn to server A and rsync'ing it with a web server. To perform these updates, a special user (called sync_user) was created with sufficient permissions for each side (server A and web server). The script uses "su sync_user" to export svn and rsync as sync_user:
export -f sync_section su sync_user -c "sync_section $source $tmp $dest"
where sync_section is a function in the script:
# critical section which performs the actual website update (export & sync)
The idea is that everyone who has permission to update / synchronize the web server knows the sync_user password, so they can enter the "su sync_user" section.
Sounds good in theory, but rsync is not happy with this setting and gives me the following error message: (user_x is the user calling the script)
#### rsync output: building file list ... rsync: pop_dir "/home/user_x" failed: Permission denied (13) rsync error: errors selecting input/output files, dirs (code 3) at flist.c(1314) [sender=2.6.8]
After some googeling, I found that the problem I am facing is caused by rsync, as it requires sync_user to have full permissions in the callerβs home directory script. It's right? and if so, why? and is there any work for this?
Note. The user's home directory is not used at all in the script. Only / tmp / is used on server A and / var / www / vhosts / on the web server.
source share