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 26 11:33

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

On Fri, 19 Oct 2007 13:25:58 -0700
Richard Burkhart <richard@khanfusion.net> wrote:

> 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.)

I thought the p option to tar was supposed to do that. This was
(basically) the command I used to migrate my whole system to a new hard
drive, so I know it preserves ownership. It may be that you can only do
that if you're root.

> 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). 

/src-dir on the source will correspond to /target-dir on the target. If
you want to get subdirectories, just name those in place of the *, and
you'll get the same subdirectory structure in /target-dir as you named
on the source side.

> 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?
> Thanks!
> Richard B.
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech

Ken Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.

Attachment: signature.asc
Description: PGP signature

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.