Download your favorite Linux distribution at LQ ISO.
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 10-19-2011, 02:18 PM   #1
Senior Member
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Rep: Reputation: 48
Question Help with rsync command

I usually don't do this right, so posting here for some help before I try it. What I want to do is rsync all files from a folder that start with wedding (not case sensitive as it could be wedding, Wedding, WEDDING, etc) and put them into a folder on another server with the same file name. For the example, all the jpg's are in /data/pics on the box i'm running this from, and i want to put them into /data/photos/weddings/2011 on I think the command should look something like this, but i'm not sure how to do the case insensitive stuff or if i'm doing anything else wrong. rsync and file masks aren't my thing yet

rsync -r -a -z -p -v -e ssh /data/pics/wedding*.jpg username@
Old 10-19-2011, 06:06 PM   #2
LQ Newbie
Registered: Jul 2011
Posts: 3
Blog Entries: 1

Rep: Reputation: Disabled

Look at the includes-from option in the man page. Put your patterns in a file. One pattern per line. For instance wedding* on one line Wedding* on the next. etc. Quoting the patterns is not necessary. I tested transferring a local file to a local file with this command.
rsync -avz --include-from='include_patterns' --exclude='*' /home/jack/Desktop/ /home/jack/rsyntest

Surely it would work the same doing a local to remote transfer. You might also want to look into the -a option. This archive option, preserves permissions, timestamps, owner and group, symbolic links, and is recursive.
Old 10-19-2011, 06:37 PM   #3
Registered: Aug 2007
Posts: 132

Rep: Reputation: 16
I would add that "-e ssh" is deprecated and not needed in a modern implementation. Typically rsync is configured to use ssh by refault.

Also, you really should lock down a file naming convention as that will save you much trouble and headache in the long run. But I understand that is not always possible.
Old 10-20-2011, 02:44 AM   #4
Senior Member
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
Thanks for the responses. they are all Windows users, so Wedding = wedding = wEdding to them, so they dont listen haha.


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
What is the perfect rsync command? szboardstretcher Linux - Software 2 06-09-2011 12:05 PM
rsync command problem aman_m03 Fedora 1 01-21-2011 05:58 AM
rsync problems, can you look at my command? - Rsync gurus. Spuddy Linux - Software 4 09-21-2010 10:25 AM
[SOLVED] rsync command windstory Linux - Newbie 2 08-10-2010 01:44 AM
rsync command problems krisrae675 Linux - Newbie 17 08-01-2009 03:23 AM > Forums > Linux Forums > Linux - Newbie

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