l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2007 Oct 20 18:07

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Copying data from Windows share to Linux server *with*original date stamps and permissions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Copying data from Windows share to Linux server *with*original date stamps and permissions

Ken Bloom wrote:
(cd /src-dir; tar cf - *) | (cd /target-dir; tar xpf -)

p is the flag to preserve permissions when extracting.
Thanks - that looks like what I'd seen out on the web. I've tested it, and while it's slow, it seems to be copying the files across with the proper file dates. (It is changing the user/group settings to the userid/groupid of the shell I'm logged in with -- but my users are all members of that group, so this should not be a problem.)

One additional question; how would I tweak the above statement so that I can copy a select handful of directories on the source, and have that directory structure show up on the target? From my dim memories of shell scripting I think it would be:
( for loop -- list directory M[6-7]0[1-7] into a variable {the 'm' directories are the only ones I'm concerned with})
--> (pass variable {w} directory name into the command above--for both the source and target directories).
Like I said; It's been a while since I've done any shell scripting - and then mostly for an ARC intro to scripting class. Is that logic on the right track? Is there a simpler way to do it?


Richard B.
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.