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.