Here is what I have been doing with rsync(This is condinced version of
the main script that runs):

        #!/usr/local/bin/bash
        SSH=/usr/local/bin/ssh
        RSYNC=/usr/local/bin/rsync
        SED=/usr/bin/sed
        USER=vmladmin
        ROLLLISTDIR=/home/vmladmin/rolllists/
        ROLLFILE=${ROLLLISTDIR}rollfile.${CELERITYID}
        EXCLUDEFILE=${ROLLLISTDIR}rollfile.exclude
        RSYNC_OPT="-zrc --delete"
        EXCLUDE="--exclude-from=${EXCLUDEFILE}"
        BACKUP="--backup-dir=/opt/staging/rollbackup/${CELERITYID}-`date
+%Y%m%d%H%M`"
        
        rsyncfiles ()
        {
        SERVER=${1}

        SRCDIR=${2}

        DESTDIR=${3}

        for FILES in `cat ${ROLLFILE} | sed 's~ $~~g' | tr " " "@"`

        do
                FNAME=`echo ${FILES} | ${SED} '[EMAIL PROTECTED] ~g'`
                ${RSYNC} -e "${SSH}" -nv ${RSYNC_OPT} ${EXCLUDE}
${BAKCUP} "${SRCDIR}${FNAME}" [EMAIL PROTECTED]:"${DESTDIR}${FNAME}"
        done
        }

What my script does, takes a list of filename found in ${ROLLFILE} and
runs a for loop that uses rsync to move the list of files from one
server to another.  This work correctly even syncing files that exist in
a dir that is symlinked to another dir on the file system.  After
upgrading to 2.6.0 when I moved to newer servers I decided to change my
script some.  One of the things I am to make work is the --files-from
option that is now avalible.  Here is somewhat of what my new script
does:
        #!/usr/local/bin/bash
        ###OPTIONS####  
        rsyncfiles ()
        {
        RSYNC_OPT=${1}
        FROMFILE=${2}
        SOURCE=${3}       # [EMAIL PROTECTED]: or :
        DESTINATION=${4}  # [EMAIL PROTECTED]: or :

        if [ -r "${FROMFILE}" ]
        then
        echo ${RSYNCCMD} -e "${SSH}" ${RSYNC_OPT} ${EXCLUDE} ${INCLUDE}
--files-from=${FROMFILE} ${SOURCE} ${DESTINATION}
                ${RSYNCCMD} -e "${SSH}" ${RSYNC_OPT} ${EXCLUDE}
${INCLUDE} --files-from=${FROMFILE} ${SOURCE} ${DESTINATION}
        fi
        }

Which I pass a command like:

        rsyncfiles "${RSYNC_OPT}" "${WEBROLLFILE}" "/"
"[EMAIL PROTECTED]:/"

This now give me an error like this when I sync the same filelist that
works with the first setup:

        delete_file: unlink "//opt/bea/vml" failed: Permission denied
        symlink "//opt/bea/vml" ->
"/opt/bea/user_projects/domains/cp-sb1/applications" failed: File exists
        rsync error: some files could not be transferred (code 23) at
main.c(632)

The new script works great as long as there is a not a symlinked dir in
the path.  So far I have nto been able to find anything on the list or
in the main page to help me with this.  Does anyone have any ideas how I
get this to work with the --files-from option?

Jeremy Grant
Unix System Admin
VML

-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to