Rsync error 13 permission denied

From Noah.org
Revision as of 03:11, 22 July 2008 by Root (Talk | contribs) (New page: Category:Engineering Sometimes when using `su` to run a script that runs `rsync` you will get an error like this: <pre> rsync: pop_dir "/home/svn" failed: Permission denied (13) rsyn...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Sometimes when using `su` to run a script that runs `rsync` you will get an error like this:

rsync: pop_dir "/home/svn" failed: Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at flist.c(1222)

In my case I was starting a script as root and the script was using `su` to change the user to "svn".

su svn -c "/home/svn/RSYNC_SVN.sh"

The fix was simply to tell `su` to use the user's environment. Note the dash after `su`:

su - svn -c "/home/svn/RSYNC_SVN.sh"