Find the answer to your Linux question:
Results 1 to 2 of 2
I'm trying to figure out how to use rsync and the filter rules to backup some of my directories. like /home and /etc. I tried a test with a few ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Dec 2008
    Posts
    166

    How do I use rsync filters for backup?


    I'm trying to figure out how to use rsync and the filter rules to backup some of my directories. like /home and /etc.
    I tried a test with a few of my home directories. I was trying to copy the health and knives directories with contents.
    Code:
    rsync -av --filter='merge /home/joe/filter-rule' documents/ test
    I used this as filter-rule:
    + */
    + /knives
    + /health
    - *
    which is what I found in the man page, as well as looking on the net for articles. This copied all the directories from documents with nothing in them.
    If I use +* for the first line it copies everything.
    What am I missing; how do I just copy the directories and contents that I want.

    Thanks

  2. #2
    Linux Newbie
    Join Date
    Dec 2008
    Posts
    166
    I think I've found the answer. For filter rule file:

    + /health/***
    + /knives/***
    - *

Posting Permissions

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