Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-20-2011, 12:23 PM   #1
LQ Newbie
Registered: Sep 2011
Location: Essex, UK
Distribution: RHEL 5
Posts: 2

Rep: Reputation: Disabled
Unhappy rysnc filter multiple files with rsp options issue

Hello hope someone can help?

I'm using the following rsync command in a script and want to stop the files listed in the filters from getting removed on the receiving side. Please note that the first two don't exist on the sender, but the third exists on both, however I don't want it transferred.

/usr/bin/rsync --delete -avze --filter="-rp_.HSResource" --filter="-rp_.HSancillary" --filter="-rsp_.DS_Store" --progress --rsh=/usr/bin/ssh $rsyncuser@$exthost:"\"$clientpath\"" $serverpath >> "$rsynclog".log

Whenever I run it I the get the error below:

invalid modifier sequence at 'p' in filter rule: -rps_.HSancillary
rsync error: syntax or usage error (code 1) at exclude.c(781) [client=2.6.8]

Through trial and error it seems that I can only have one instance of the p option in the filters. Anymore than that and the error appears, however without it in the filters, folders removed on the source get left on the receiver if they contain the files I want to filter.

Hope that makes sense.
Old 09-20-2011, 12:53 PM   #2
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 13.1
Posts: 1,330

Rep: Reputation: 254Reputation: 254Reputation: 254
What shall the filter rules achieve? To me it looks like a contradiction to use -r and -p in one and the same rule.
Old 09-20-2011, 01:07 PM   #3
LQ Newbie
Registered: Sep 2011
Location: Essex, UK
Distribution: RHEL 5
Posts: 2

Original Poster
Rep: Reputation: Disabled

Hi Reuti

Thanks for responding.

The .HSResource and .HSancillary files do not exist on the sender, but do on the receiver, so I only want them deleted on the receiver if the directory containing them is deleted on the sender.

The .DS_Store exists on both, however I don't want it to be transferred.

I'm using the rp options so it only applies on the receiver and allows the directory to be deleted even if it contains the files. That's my understanding of the rsync man page, which is probably wrong.

Hope that helps?


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[bash] find - filter files matching a list of files hashbang#! Programming 6 11-25-2010 06:01 PM
Best way to filter attachments for multiple domains sank1800 Linux - Security 2 04-01-2009 01:13 AM
blueZ does not respond to OBEX: Connect rsp(f): shitijsah Linux - Newbie 1 03-18-2009 10:50 AM
ascii filter options tannu_ah Linux - Newbie 1 03-06-2009 04:31 PM
HELP: rysnc filled my partition during backup. PhilK Linux - Newbie 1 08-03-2007 05:39 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:57 AM.

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