LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 09-02-2004, 04:08 AM   #1
tricky1234
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Rep: Reputation: 0
Rsync help


Hi

I am having a problem with Rsync. I need to sync an 'Images' directory from one development server to a range of live servers with an 'Images' directory. I only want to sync the *.jpg and *.gif files from the directory. I have got the rsync to work but the problem I have is that it changes the permissions on the liveservers 'Images' directory to the root user. This stops the content system from being able to lauch the images on the live servers.

Does anyone know why rsync has to change the permissions on the live server Images directory - why cant it just sync the contents of the directory with the dev server?

This works fine just moving .jpg files:

#!/bin/sh
/usr/local/bin/rsync -av --password-file=/etc/rsync.pwd \
--rsh=/opt/OBSDssh/bin/ssh --rsync-path=/usr/local/bin/rsync \
rsynctarget@targetserver:/export/home/jakarta-tomcat-4.0.4/webapps/site/Images/*.jpg /liveserver/docroot/Images

But if I try to sync both *.jpg and *.gif with this script the permissions on the live servers Images directory is changes to root and the modification date is updated each time rsync runs:

#!/bin/sh
/usr/local/bin/rsync -av --password-file=/etc/rsync.pwd \
--rsh=/opt/OBSDssh/bin/ssh --rsync-path=/usr/local/bin/rsync \
--include="*.gif" \
--include="*.jpg" \
--exclude="*" \
rsynctarget@targetserver:/export/home/jakarta-tomcat-4.0.4/webapps/site/Images/ /liveserver/docroot/Images

I am running the script on the root crontab. Do I have to run the script on a crontab related to the owner of the Images directory so permissions arent a problem?

Thanks for any help

T.
 
Old 09-02-2004, 01:32 PM   #2
scissors
Member
 
Registered: Aug 2004
Location: Seattle
Distribution: Red Hat es and as, Solaris, Fedora, Debian, Tru64
Posts: 45

Rep: Reputation: 15
Try using the 'p' flag.

p is for 'preserve permissions.'
 
Old 09-06-2004, 07:04 AM   #3
tricky1234
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Original Poster
Rep: Reputation: 0
The source directory has root permissions, the destination directory has developer permissions.

When I run the rsync script it overwrites the directory permissions on the destination directory with root permissions.

It appears my script is syncing the directories rather than just the contents of the directories.

Any ideas? I tried the --perm flag but it didnt prevent the destination directory permissions from being changed.
 
Old 09-07-2004, 10:08 AM   #4
scissors
Member
 
Registered: Aug 2004
Location: Seattle
Distribution: Red Hat es and as, Solaris, Fedora, Debian, Tru64
Posts: 45

Rep: Reputation: 15
Add a '/' after both directories:

rsynctarget@targetserver:/export/home/jakarta-tomcat-4.0.4/webapps/site/Images/ /liveserver/docroot/Images/
 
  


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
Rsync sant25 Linux - General 2 09-02-2005 03:34 PM
rsync $@ya Linux - Software 1 06-06-2005 11:45 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
rsync-2.4.6-2 santha Linux - Software 1 08-25-2004 04:35 AM
Rsync buttersoft Linux - Software 4 11-05-2003 11:37 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 03:31 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