Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sync/copy-overwrite selected directorrys

Posted on 2013-06-19
2
Medium Priority
?
264 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 31

Accepted Solution

by:
serialband earned 2000 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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 how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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…
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

963 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