Solved

sync/copy-overwrite selected directorrys

Posted on 2013-06-19
2
257 Views
Last Modified: 2013-06-21
Hi,

I got as little challenge and would need some assistance since I am scared I mess up all my work.
I made an rsync of my old server to a new one. So basically I have a full copy of the old server.
I now have my sew server ready and over the last 2 weeks copied all my public_http folders from the old copy to my new location.
However since it took a wile to do this I now made another rsync and have updated files.

The issue I am facing is that I like to now not copy all home directorys since I made lots of changes to the html files and settings. Instead I only like to copy the log and maildir directories.

So basically I have

/public_http/username/http
/public_http/username/cgi-bin
/public_http/username/log
/public_http/username/maildir
and
/public_http/mailusers/username/maildir
/public_http/mailusers/username/log

of course I could make an rsync from my old_public_http to the new_public_http. But I only want to overwrite the /log and /maildir folders and not the htdocs and cgi-bin folders.

If these a smart way to do this?

Thank you for your assistance.

Best wishes,
Thomas
0
Comment
Question by:Thomanji
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
serialband earned 500 total points
ID: 39260872
You might be able to exclude the folders.
rsync -avz --exclude="/http" --exclude="cgi-bin" /public_http/ remote_server/

or, if there's too many other files, you could just loop through and copy just the log and maildir folders.
 
cd /public_http
for username in * ; rsync -avz /public_http/$username/log/ remotes_server:/public_http/user/log/;rsync -avz /public_http/$username/maildir/ remotes_server:/public_http/user/maildir/; done
0
 

Author Closing Comment

by:Thomanji
ID: 39267568
Thank you for the help
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question