LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-29-2008, 01:42 PM   #1
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
Help with rsync filter file


I want to have some filter for my home directory like:

Code:
# My rsync filter

+ /.mozilla/
- /.mozilla/firefox/*/Cache/
- /.mozilla/firefox/*/lock
- /.mozilla/firefox/*/.parentlock

+ /.mozilla-thunderbird/
- /.mozilla-thunderbird/*/lock
- /.mozilla-thunderbird/*/.parentlock

+ /.purple/

+ /.gnupg/

+ /.ssh/

+ /Documents/

+ /Pictures/

+ /Music/

+ /Video/

+ /bin/

+ /Database.kdb

- Thumbs.db
- thumbs.db
- Desktop.ini
- desktop.ini
which I should be able to run with a command like:
Code:
$ rsync -r -a --filter-file=myfile ~/ /media/backup
However it's saying things like "+ /.mozilla" is not a file. So I tried renaming the file to .rsync-filter and invoking the -F option however it recursively included EVERYTHING. Do I need a - /** option or something?

Which of the filter file options am I supposed to use with a file like this?
 
Old 09-29-2008, 06:59 PM   #2
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Original Poster
Rep: Reputation: 67
I was able to do this:

Code:
$ rsync -a --filter='merge .rsync-filter' ~ /media/backup
with the following .rsync-filter file:
Code:
+ /.mozilla/
- /.mozilla/firefox/*/Cache/
- /.mozilla/firefox/*/lock
- /.mozilla/firefox/*/.parentlock
+ /.mozilla-thunderbird/
- /.mozilla-thunderbird/*/lock
- /.mozilla-thunderbird/*/.parentlock
+ /.purple/
+ /.gnupg/
+ /.ssh/
+ /Documents/
+ /Pictures/
+ /Music/
+ /Video/
+ /bin/
+ /Database.kdb

- /*
Is that the best way to do an explicit include? What's the deal with the --files-from option?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter file sharing inaki General 3 01-12-2007 07:46 AM
Script filter a file onradius Programming 4 02-21-2006 07:38 PM
php filter file name question feetyouwell Programming 1 01-31-2005 12:48 PM
how to open file in filter program? jayashrik Programming 1 01-26-2005 01:48 AM
Need help with grep, trying to parse/filter a file... patsnip Programming 4 08-29-2003 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration