Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-10-2012, 04:11 AM   #1
LQ Newbie
Registered: Aug 2012
Posts: 13

Rep: Reputation: Disabled
Unhappy Rsync Permission denied errors.

Hello Guys,

I have been making a script to automatically rsync about 40 different directories to 40 other different directories. I finally got all the syntax and everything worked out but I'm having some permissions errors pop up when I try to do the rsync.

Here is my bash script:

The error I get when I run it is:

[root@KISKA Tech]# ./
doing some cleanup
writing directory names to kiskasys.txt
I am now nusak at
just wrote directory names to websys.txt
websys.txt                                                                                                                                  100%  244     0.2KB/s   00:00
Just coppied websys.txt from webserver to
rsync: Failed to exec /nusdata/staff/NUS/NUS/Systems/101 greenbrook/: Permission denied (13)
rsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.6]
rsync: writefd_unbuffered failed to write 6 bytes to fd 4 [sender]: Broken pipe (32)
rsync error: error in rsync protocol data stream (code 12) at io.c(1525) [sender=3.0.6]
I ran the script as root so I would figure that the local file would have no permissions issues... but obviously I am missing something.

Any help would be appreciated!
Old 08-10-2012, 04:10 PM   #2
LQ Newbie
Registered: Aug 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Found the problem. I was using -e before both the local directory and the ssh command... the -e has to go after the local directory but before the ssh command
Old 08-13-2012, 11:28 AM   #3
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 13.1
Posts: 1,323

Rep: Reputation: 252Reputation: 252Reputation: 252
It should also work if the -e including its argument are before the local directory. More important is, that -e needs an argument. Most likely you are referring to this argument by “ssh command”.
Old 08-13-2012, 01:39 PM   #4
Senior Member
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 4,469

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Flags such as -e require an argument. The syntax is "program flag argument", so your ssh argument needs to immediately follow the -e flag.

-e tells rsync what remote shell to use for the transfer (such as ssh or rsh). By putting your local directory name after -e, rsync is trying to use your local directory AS the transfer shell. In other words, you're telling rsync that the directory is actually a program that rsync should execute in order to facilitate the transfer. That's why you got the error, rsync was unable to "execute" the directory: "rsync: Failed to exec /nusdata/staff/..."

Last edited by suicidaleggroll; 08-13-2012 at 01:41 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] rsync permission denied Mike2323 Linux - Server 10 10-05-2011 11:25 AM
rsync permission denied even root packets Linux - Networking 10 04-15-2010 03:56 AM
CRON problem: (rsync: Failed to exec ssh: Permission denied (13)) Fairys Fedora 6 01-16-2008 07:34 PM
Rsync: permission denied jevin Linux - General 3 04-13-2007 10:37 AM
rsync permission denied macadam Linux - Networking 0 06-18-2006 04:35 AM

All times are GMT -5. The time now is 04:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration