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 07-13-2013, 02:19 PM   #1
Registered: Jun 2013
Posts: 36

Rep: Reputation: Disabled
Why is `rsync` recursing?

rsync's --help shows there is a flag, "-r" (or maybe "--recursive") which help says "recurse into directories". I did not use tha flagt, but `rsync` is copy a bunch of huge subdirectories (well, I hit Ctrl-C - but it would have!). Why is it copying these subdirectories? How do I make it stop? Here is the (slightly edited) command I used

>rsync -rv* .
Also note that there are no aliases:
>alias rsync
-bash: alias: rsync: not found
Old 07-13-2013, 02:25 PM   #2
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
But you do have the "r" option specified.
rsync -rv*
Old 07-13-2013, 03:01 PM   #3
Registered: Jun 2013
Posts: 36

Original Poster
Rep: Reputation: Disabled
Originally Posted by PTrenholme View Post
But you do have the "r" option specified.
rsync -rv*
D'oh! That was supposed to be a "u"! (Next time I'll read what I write before I post it!)
Old 07-14-2013, 12:08 AM   #4
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
a few things.

1. with the * at the end you are telling the system to grab everything after /code/*, this will grab subdirectories as well. be more specific to the source if you dont want subdirectories, dont use the wildcard.

2. try running your command without the destination:

rsync -rv*
from the man page for rsync:

As a special case, if a single source arg is specified without a destination, the files are
listed in an output format similar to “ls -l”.
This will allow you to see exactly what it is going to move without actually moving any files around before hand so you can play with your pathing to sort things out.


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
[SOLVED] svn-all-fast-export: rev x did not match any rules; auto-recursing eantoranz Programming 3 03-14-2013 04:23 PM
Segmentation fault when the recursing through a large file structure vbnandu86 Programming 1 07-30-2010 04:53 AM
Could I run rsync to download files from a server without rsync daemon? Richard.Yang Linux - Software 1 09-18-2009 05:08 AM
Recursing through a tree in Perl hakmed Programming 1 11-16-2006 02:03 PM
How Can I get the Total Size of a Dir w/o Recursing Into it? linuxSysProg Programming 3 08-08-2003 09:39 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:44 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