Note that there are some explanatory texts on larger screens.

plurals
  1. POrsync pop_dir "/home/user_x" failed: permission denied, why?
    primarykey
    data
    text
    <p>I am currently writing a bash shell script to transfer the latest revision of our svn repository to a webserver. This is done using svn export to server A and rsync'ing it with the webserver, a special user (called sync_user) was created with sufficient permissions on each side (server A and the webserver) to perform these updates. The script uses "su sync_user" to perform the svn export and rsync as sync_user : </p> <pre><code>export -f sync_section su sync_user -c "sync_section $source $tmp $dest" </code></pre> <p>where sync_section is a function in the script:</p> <pre><code># critical section which performs the actual website update (export &amp; sync) # takes 3 parameters: source, tmp, dest function sync_section { source=$1 tmp=$2 tmp_old=$tmp"_old" dest=$3 #enter critical section set -e # export to temp folder on server A svn export -q --force $source $tmp --native-eol LF # rsync with remote live website folder. rsync -avzhiO $tmp $dest # clean up rm -rf $tmp_old mv -f $tmp $tmp_old # exit critical section set +e } </code></pre> <p>The idea is that everyone who has permissions to update/sync the webserver knows the sync_user's password, thus can enter into the "su sync_user" section. </p> <p>Sounds good in theory but rsync is not happy with this setup and gives me the following error message: (user_x is the user calling the script)</p> <pre><code>#### 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] </code></pre> <p>After some googeling I found out that the problem I am having is caused by rsync as it requires the sync_user to have full access permissions on the script caller's home directory. Is that correct? and if so why? and is there a work-around for it? </p> <p><strong>Note:</strong> The home directory of the user is not used at all in the script. Only /tmp/ on server A and /var/www/vhosts/ on the webserver are used. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload