LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-04-2014, 05:46 AM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
rsync is not including the dirs that I wanted


I have this script to rsync my directories.

Code:
#!/bin/bash
# set -xv
FILTER="
+  Documents
+  Programs
+  Projects
+  bash-files
+  bookmarks
+  repositories
+  scripts
+  scripts
+  servers
+  workspace
-  *
"

echo "$FILTER" | rsync -avr --dry-run --include-from=- --progress -s $HOME/ "$1"
The problem is that it is rsync'ing files that I did not include in the list. e.g., .cache dir. What is wrong with my script? Am I missing setting any excludes?
 
Old 06-04-2014, 07:26 AM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Rsync syncs evertyhing by default. If you want to skip directories you have to exclude them. The include directive is to specify directories which are not excluded. This wording is from the man page.

So it seems that if you want to include only specified directories, you have to exclude everything. In your include statement you would specify what not to exclude.

jlinkels
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to rsync some dirs for backup? shams Linux - Software 1 01-01-2013 11:41 AM
[SOLVED] Apple gcc: Insert include dirs between -I dirs and -isysroot dirs f.barker Programming 1 11-11-2011 11:19 AM
rsync dirs w/o o+x perms (as root) guttersnipe Linux - Software 2 06-04-2009 11:54 PM
Video editing program wanted including fading from one clip to another Pantherman Linux - General 4 04-15-2009 05:12 AM
Rsync changing owner of dirs Harlin Linux - Security 1 03-30-2007 02:11 PM


All times are GMT -5. The time now is 02:34 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration