Latest LQ Deal: Linux Power User Bundle
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 06-04-2014, 04:46 AM   #1
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.

# set -xv
+  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, 06:26 AM   #2
Senior Member
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Stretch/Sid, Linux Mint DE
Posts: 4,612

Rep: Reputation: 690Reputation: 690Reputation: 690Reputation: 690Reputation: 690Reputation: 690
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.



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 10:41 AM
[SOLVED] Apple gcc: Insert include dirs between -I dirs and -isysroot dirs f.barker Programming 1 11-11-2011 10:19 AM
rsync dirs w/o o+x perms (as root) guttersnipe Linux - Software 2 06-04-2009 10:54 PM
Video editing program wanted including fading from one clip to another Pantherman Linux - General 4 04-15-2009 04:12 AM
Rsync changing owner of dirs Harlin Linux - Security 1 03-30-2007 01:11 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:50 PM.

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