LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-19-2009, 05:02 PM   #1
holmesjl
LQ Newbie
 
Registered: Feb 2009
Posts: 1

Rep: Reputation: 0
Exclamation cp or rsync??


I am in need of copying file of a specific format (mp3, mp4, png, tiff, jpg, jpeg...) from a folder on one server to another. I need to maintain the folder/file structure so that "somedironSever1"/images/2009/fall/Eventone/file.png is copied to "somedironSever2"/file/myfiles/images/2009/fall/Eventone/file.png.

I don't believe I need to supply anymore details since it shouldn't be distro specific but I will say that they are on the latest Ubuntu Sever version I believe.

I am not quite sure if cp has the power to do what I need or if rsync has the flexibility to do it either.

If someone could provide an example of whatever command or script I would need to do this that would be wonderful. If someone finds a post or forum that may be help thats good also. Also, if someone knows of some tag words that I could use to search for this type of request for say searching on google that would help, besides "cp" and "rsync".

Thanks.
 
Old 02-19-2009, 05:30 PM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You could use

rsync -avm --del --include='*.png' -f 'hide,! */' /source/ Server2:/destination

This is straight from man rsync.
 
  


Reply

Tags
copy, cp, directory, rsync, structure


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with rsync ryanlum Linux - General 6 09-16-2007 10:51 PM
Help with rsync Goria Debian 2 12-02-2006 11:49 AM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 01:10 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 03:49 PM
rsync becks.lin Linux - Software 6 03-22-2004 08:45 PM


All times are GMT -5. The time now is 09:44 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration