Solved

sync/copy-overwrite selected directorrys

Posted on 2013-06-19
2
261 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 30

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

623 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