LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-13-2013, 01:19 PM   #1
Jeff9
Member
 
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

Code:
>rsync -rv localmachine.university.edu:FPU/code/* .
Also note that there are no aliases:
Code:
>alias rsync
-bash: alias: rsync: not found
 
Old 07-13-2013, 01:25 PM   #2
PTrenholme
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.
Code:
rsync -rv localmachine.university.edu:FPU/code/*
 
Old 07-13-2013, 02:01 PM   #3
Jeff9
Member
 
Registered: Jun 2013
Posts: 36

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by PTrenholme View Post
But you do have the "r" option specified.
Code:
rsync -rv localmachine.university.edu:FPU/code/*
D'oh! That was supposed to be a "u"! (Next time I'll read what I write before I post it!)
 
Old 07-13-2013, 11:08 PM   #4
lleb
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:

Code:
rsync -rv localmachine.university.edu:FPU/code/*
from the man page for rsync:

Quote:
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.
 
  


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


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