LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-10-2012, 03:11 AM   #1
KroniK
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: http://pastebin.com/uph49vHd

The error I get when I run it is:

Code:
[root@KISKA Tech]# ./websync.sh
doing some cleanup
writing directory names to kiskasys.txt
I am now nusak at foo.bar.net
just wrote directory names to websys.txt
websys.txt                                                                                                                                  100%  244     0.2KB/s   00:00
Just coppied websys.txt from webserver to KISKA.nusalaska.com
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, 03:10 PM   #2
KroniK
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, 10:28 AM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
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, 12:39 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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 12:41 PM.
 
  


Reply



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 10:25 AM
rsync permission denied even root packets Linux - Networking 10 04-15-2010 02:56 AM
CRON problem: (rsync: Failed to exec ssh: Permission denied (13)) Fairys Fedora 6 01-16-2008 06:34 PM
Rsync: permission denied jevin Linux - General 3 04-13-2007 09:37 AM
rsync permission denied macadam Linux - Networking 0 06-18-2006 03:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:47 PM.

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