AARGH! I can't make rsync not copy dirs with --files-from option

David C. Rankin drankinatty at suddenlinkmail.com
Sat Mar 14 21:11:12 GMT 2009


Listmates

	I'm running rsync 3.02 and I have a simple thing I'm trying to do, but rsync
won't let me do it. What I'm trying to do is consolidate saved rpms on openSuSE
11.0 to a central server for local updates. openSuSE saves the rpms in:

/var/cache/zypp/packages/<repository name>

	I have written a script that parses all the file names and creates temp files
that holds the full path to the rpms. The rpms are separated into 5 files which
are used to categorize the rpms (delta i586 noarch src x86_64). An example of
the file contents is:

17:34 alchemy:~/linux/scripts/config/zypp> tail -n3 /tmp/zyppcon/*
==> /tmp/zyppcon/delta <==
/var/cache/zypp/packages/openSUSE-11.0-Updates/rpm/x86_64/satsolver-tools-0.9.5_0.9.6-0.1.x86_64.delta.rpm
/var/cache/zypp/packages/openSUSE-11.0-Updates/rpm/x86_64/glibc-info-2.8-14.1_14.2.x86_64.delta.rpm
/var/cache/zypp/packages/openSUSE-11.0-Updates/rpm/i586/flash-player-9.0.151.0_9.0.152.0-0.1.i586.delta.rpm

==> /tmp/zyppcon/i586 <==
/var/cache/zypp/packages/kde/i586/kdebase3-nsplugin-3.5.10-40.3.i586.rpm
/var/cache/zypp/packages/kde/i586/kdebase3-nsplugin-3.5.10-97.3.i586.rpm
/var/cache/zypp/packages/kde/i586/kdebase3-nsplugin-3.5.10-40.2.i586.rpm

==> /tmp/zyppcon/noarch <==
/var/cache/zypp/packages/tools/noarch/inst-source-utils-2009.1.25-2.3.noarch.rpm
/var/cache/zypp/packages/tools/noarch/build-2009.02.20-30.2.noarch.rpm
/var/cache/zypp/packages/backports/noarch/digikam-doc-0.9.4-3.2.noarch.rpm

==> /tmp/zyppcon/src <==
/var/cache/zypp/packages/multimedia-photo/src/exiftool-7.56-1.1.src.rpm
/var/cache/zypp/packages/packman/SRPMS/qps-1.10.2-0.pm.1.src.rpm

==> /tmp/zyppcon/x86_64 <==
/var/cache/zypp/packages/backports/x86_64/digikam-lang-0.9.4-54.3.x86_64.rpm
/var/cache/zypp/packages/backports/x86_64/kipi-plugins-lang-0.1.6-3.2.x86_64.rpm
/var/cache/zypp/packages/backports/x86_64/kio_iso-1.99.1.svn6082-7.1.x86_64.rpm

	These files are on host 'alchemy'. I want to rsync them to host 'nirvana'
under /home/backup/rpms/(delta,i586,noarch,src,x86_64), respectively.  The
rsync call in the script is is:

REPOHOST=nirvana.3111skyline.com
REPOPATH=/home/backup/rpms
TEMPDIR=/tmp/zyppcon
TMPDIREXISTS=0
RUSER=david

/usr/bin/rsync -auv --files-from=${TEMPDIR}/${i} /
${RUSER}@${REPOHOST}:${REPOPATH}/${i}

	rsync is called from within a for loop where $i iterates through the files
(delta,i586,noarch,src,x86_64)

	All I am trying to do is to rsync (say for example this file):

/var/cache/zypp/packages/openSUSE-11.0-Updates/rpm/x86_64/satsolver-tools-0.9.5_0.9.6-0.1.x86_64.delta.rpm

	from alchemy and have it end up in nirvana:/home/backup/rpms/delta. (it would
be rsync'ed when $i=delta.

	For the life of me I *can't make it work*. I have tried every combination of
--no-relative, --no-dirs and --no-implied-dirs (I know, but I was desperate),
and no matter what I do, the files end up in:

nirvana:/home/backup/rpms/var/cache/packages/openSUSE-11.0-Updates/rpm/x86_64/

	Way too much path, way way too much path. There are thousands of rpms, so the
thought of calling rsync for every file is a no go

-- 
David C. Rankin, J.D.,P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com


More information about the rsync mailing list