Solved

sync/copy-overwrite selected directorrys

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AWS- KeepAlived notify script not working 23 103
batch file problem 5 67
cannot rename datastore 3 68
lunix and unix command 21 85
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

792 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