Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2005
    Posts
    2,175

    how to do this with rsync?

    I want rsync to exclude all files and directories under var/cache/yum. How do I do that? Thanks in advance.

  2. #2
    Join Date
    Apr 2004
    Location
    San Jose
    Posts
    902
    From the man page:
    Code:
    --exclude=PATTERN       exclude files matching PATTERN
    --exclude-from=FILE     read exclude patterns from FILE
    Specializing in MySQL and website tuning for high traffic sites. cmwsci.com/

  3. #3
    Join Date
    Jan 2005
    Posts
    2,175
    I already looked at it, a tad confusing. could you just give me the exact line to write?

  4. #4
    Join Date
    Nov 2005
    Location
    Minneapolis, MN
    Posts
    1,648
    --exclude="*var/cache/yum/*"
    Eric Spaeth
    Enterprise Network Engineer :: Hosting Hobbyist :: Master of Procrastination
    "The really cool thing about facts is they remain true regardless of who states them."

  5. #5
    Join Date
    Apr 2004
    Location
    San Jose
    Posts
    902
    Well, I don't know where you're copying from, but assuming it's /, then do this:
    Code:
    rsync --exclude=yum -avz / remote:/destDir
    This will skip any directories or files named yum.

    If you have other files or directories named yum, then ask again.
    Specializing in MySQL and website tuning for high traffic sites. cmwsci.com/

  6. #6
    Yup what sailorFred said will work, but if you have other directories named yum, then try:

    Code:
    rsync --exclude="/var/cache/yum" -avzP / remote:/destDir
    Because there is only one dir that would match /var/cache/yum
    Gavin Rogers, full time problem solver.

  7. #7
    Join Date
    Jan 2005
    Posts
    2,175
    Quote Originally Posted by gavin8or
    Yup what sailorFred said will work, but if you have other directories named yum, then try:

    Code:
    rsync --exclude="/var/cache/yum" -avzP / remote:/destDir
    Because there is only one dir that would match /var/cache/yum
    This would exclude all directories inside /var/cache//yum ?

  8. #8
    Yes, because all the dirs inside of /var/cache/yum have that pattern as part of their path, do they not?
    Gavin Rogers, full time problem solver.

  9. #9
    Join Date
    Apr 2004
    Location
    San Jose
    Posts
    902
    The reason I suggested just using "yum" was because my test indicated that using the path did not work.
    Specializing in MySQL and website tuning for high traffic sites. cmwsci.com/

  10. #10
    Join Date
    Nov 2005
    Location
    Minneapolis, MN
    Posts
    1,648
    It's a shell-interpreted match -- if you want to do pattern matching, you need to wildcard it with *
    Eric Spaeth
    Enterprise Network Engineer :: Hosting Hobbyist :: Master of Procrastination
    "The really cool thing about facts is they remain true regardless of who states them."

  11. #11
    Join Date
    Jan 2005
    Posts
    2,175
    how do I add another path in addition to the one above? thanks.

  12. #12
    Join Date
    Nov 2005
    Location
    Palma de Mallorca, Spain
    Posts
    259
    Quote Originally Posted by ANewDay
    how do I add another path in addition to the one above? thanks.
    Just add another --exclude option to the line.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •