Rsync error 13 permission denied

From Noah.org
Revision as of 04: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 navigationJump to 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"