Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[Q]Copie dossier et Terminal

 
   Macintosh computer (Home) -> System RSS
Next:  Copy partition (/harddisk) on old slot-loading iM..  
Author Message
Henri

External


Since: Feb 06, 2007
Posts: 8



(Msg. 1) Posted: Mon Jun 25, 2007 12:43 pm
Post subject: [Q]Copie dossier et Terminal
Archived from groups: comp>sys>mac>system (more info?)

J'ai fait des essais de copie sur clef USB d'un dossier contenant des
sous dossiers eux même contenant des photos. Dossier env. 1 Go, 30 sous
dossiers, 550 photos, clef 2Go.
C'est abominablement long, 35 min, et j'ai donc essayé dans le Terminal
avec mv et une commande :

"mv chemin_dossier_origine ClefUSB/Nouveau_dossier" où Nouveau_dossier
n'existe pas à l'origine mais est bien créé par la commande.
Cela va beaucoup plus vite, les sous dossiers sont créés, les photos
sont copiées, mais...
- le Terminal énumère les photos au fur et à mesure et ajoute à la fin
de chaque chemin "invalid argument"
- les photos arrivent sans leur icone personnalisée

Cela fait penser qu'il y a un pb avec une partie Ressources qui ne passe
pas

Qu'ai-je raté, et comment faire une copie correcte et complète par le
Terminal d'un gros dossier complexe?

Merci de vos lumières.
HC

 >> Stay informed about: [Q]Copie dossier et Terminal 
Back to top
Login to vote
Jeffrey Goldberg

External


Since: May 14, 2004
Posts: 879



(Msg. 2) Posted: Mon Jun 25, 2007 12:43 pm
Post subject: Re: [Q]Copie dossier et Terminal [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Henri wrote:
> J'ai fait des essais de copie sur clef USB d'un dossier contenant des
> sous dossiers eux même contenant des photos. Dossier env. 1 Go, 30 sous
> dossiers, 550 photos, clef 2Go.
> C'est abominablement long, 35 min, et j'ai donc essayé dans le Terminal
> avec mv et une commande :
>
> "mv chemin_dossier_origine ClefUSB/Nouveau_dossier" où Nouveau_dossier
> n'existe pas à l'origine mais est bien créé par la commande.
> Cela va beaucoup plus vite, les sous dossiers sont créés, les photos
> sont copiées, mais...
> - le Terminal énumère les photos au fur et à mesure et ajoute à la fin
> de chaque chemin "invalid argument"
> - les photos arrivent sans leur icone personnalisée
>
> Cela fait penser qu'il y a un pb avec une partie Ressources qui ne passe
> pas
>
> Qu'ai-je raté, et comment faire une copie correcte et complète par le
> Terminal d'un gros dossier complexe?

The Unix mv command does not work across filesystems (Volumes), so you
cannot use mv to move files or directories (folders) from one volume to
another. Instead you will need to do a copy (cp) and then remove the
original. To copy a directory (folder) with all of its contents you
will need to use

cp -R

I hope that this helps.

Cheers,

-j

 >> Stay informed about: [Q]Copie dossier et Terminal 
Back to top
Login to vote
Henri

External


Since: Feb 06, 2007
Posts: 8



(Msg. 3) Posted: Mon Jun 25, 2007 9:24 pm
Post subject: Re: [Q]Copie dossier et Terminal [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jeffrey Goldberg <nobody DeleteThis @goldmark.org> wrote:

> cp -R
> I hope that this helps.

I was quite baffled to get this answer in English then realized I had
posted in an other group than intended. Congratulation for your literacy
in French ;-)
Obviously in the long list of option I overlooked -R

Anyway I tried the above and the copy goes without any more error
messages. However the images still arrive with generic icons.

Running "man -k cp" I discovered that a command specific to Mac's would
exist, namely CpMac. A man page exists for it and according to the
description it could be the Graal. But unfortunately I can't find it on
my machine, and only the man page is found in a search. The same goes
for an other command called MvMac, only the man page is to be found.
Would you have any light on those two ?
I am running tcsh which maybe does not use these but I suppose a Finder
search should unearth them anyway.
Thanks for your help
HC
 >> Stay informed about: [Q]Copie dossier et Terminal 
Back to top
Login to vote
Jeffrey Goldberg

External


Since: May 14, 2004
Posts: 879



(Msg. 4) Posted: Mon Jun 25, 2007 9:24 pm
Post subject: Re: [Q]Copie dossier et Terminal [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Henri wrote:
> Jeffrey Goldberg <nobody.TakeThisOut@goldmark.org> wrote:
>
>> cp -R
>> I hope that this helps.
>
> I was quite baffled to get this answer in English then realized I had
> posted in an other group than intended. Congratulation for your literacy
> in French ;-)

I studied a little French in high school almost 30 years ago, but
somehow your message was clear enough that even I could understand it.

> Obviously in the long list of option I overlooked -R
>
> Anyway I tried the above and the copy goes without any more error
> messages. However the images still arrive with generic icons.

Ah, that is right. The standard BSD tools don't deal with the resource
forks. There are some tools that come with the developer tools that
will use copy the resource forks.

The most powerful command line copying tool, rsync, does deal with
resource forks when copying from HFS+ to HFS+ on OS X. rsync can be
used for many things, but for a simple directory copy you can use

rsync -a source-directory destination-directory

rsync is often used for making backups because it will copy only the
differences between the source and the destination. Also with the -a
option it will do its best to preserve file time stamps and ownership
information.

> Running "man -k cp" I discovered that a command specific to Mac's would
> exist, namely CpMac. A man page exists for it and according to the
> description it could be the Graal.

It comes with the developer tools. If you install Xcode then a number
of other utilities become available.

-j
 >> Stay informed about: [Q]Copie dossier et Terminal 
Back to top
Login to vote
Andrew Templeman

External


Since: Apr 30, 2004
Posts: 19



(Msg. 5) Posted: Mon Jun 25, 2007 9:52 pm
Post subject: Re: [Q]Copie dossier et Terminal [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Henri <yapersonne.DeleteThis@nowhere.com> wrote:

> Jeffrey Goldberg <nobody.DeleteThis@goldmark.org> wrote:
>
> > cp -R
> > I hope that this helps.
>
> I was quite baffled to get this answer in English then realized I had
> posted in an other group than intended. Congratulation for your literacy
> in French ;-)
> Obviously in the long list of option I overlooked -R
>
> Anyway I tried the above and the copy goes without any more error
> messages. However the images still arrive with generic icons.
>
> Running "man -k cp" I discovered that a command specific to Mac's would
> exist, namely CpMac. A man page exists for it and according to the
> description it could be the Graal. But unfortunately I can't find it on
> my machine, and only the man page is found in a search. The same goes
> for an other command called MvMac, only the man page is to be found.
> Would you have any light on those two ?
> I am running tcsh which maybe does not use these but I suppose a Finder
> search should unearth them anyway.
> Thanks for your help
> HC

These are part of the Developer tools install. You should find the
installer on your OS X disks.




--
Andy Templeman <http://www.templeman.org.uk/>
 >> Stay informed about: [Q]Copie dossier et Terminal 
Back to top
Login to vote
Henri

External


Since: Feb 06, 2007
Posts: 8



(Msg. 6) Posted: Tue Jun 26, 2007 2:46 pm
Post subject: Re: [Q]Copie dossier et Terminal [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jeffrey Goldberg <nobody.RemoveThis@goldmark.org> wrote:

> I studied a little French in high school almost 30 years ago
Excellent remains!

> rsync -a source-directory destination-directory
>
I tried it and *that* is fast. Pity is the files still lack the
personnalized icon and I again get error messages. The command was

[iMacHC:~] henri% rsync -a /Volumes/SOS/Photos/StBonnet /Volumes/DAN_2G
where "DAN_2G" is the 2Go USB key.

Folder "StBonnet" is created on the key, as well as the 3 sub folders
with the pictures, with for each item an error like :

chgrp "/Volumes/DAN_2G/StBonnet" failed: Invalid argument
chgrp "/Volumes/DAN_2G/StBonnet/1 En_route" failed: Invalid argument
chgrp "/Volumes/DAN_2G/StBonnet/1 En_route/01 Ste Croix.jpg" failed:
Invalid argument
.......etc
I looked for man chgrp, concluded that the culprit could be the DOS
format of the key, changed to HFS+. No more errors but still no icon and
seemingly a reduction in speed. It remains somewhat faster than a Finder
copy but slower than with the DOS format.

> It comes with the developer tools.
> If you install Xcode then a number of other utilities become available.
>
Well, to save time once in a blue moon I am not sure it is worth it,
unless curiosity and frustration lead me to such extremes some day.
There must be a solution as CarbonCopyCloner does that kind of job
without the drawbacks. But as it is not everyday that I will want to
copy a huge folder on a key I think I will drop it at that for now.

It was interesting anyway. I don't think I really *need* to learn all of
Unix but every now and then I bump into sth that pushes me a little
further. It sure can be an asset at times but not so often for my usual
use.
Thanks for your help and indications.
HC
 >> Stay informed about: [Q]Copie dossier et Terminal 
Back to top
Login to vote
Jeffrey Goldberg

External


Since: May 14, 2004
Posts: 879



(Msg. 7) Posted: Tue Jun 26, 2007 2:46 pm
Post subject: Re: [Q]Copie dossier et Terminal [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Henri wrote:
> Jeffrey Goldberg <nobody DeleteThis @goldmark.org> wrote:
>
>> I studied a little French in high school almost 30 years ago
> Excellent remains!
>
>> rsync -a source-directory destination-directory
>>
> I tried it and *that* is fast.

rsync is designed to copy only the minimum of what's needed to sync the
the directories.

> Pity is the files still lack the
> personnalized icon and I again get error messages.

Ah. I guess that it is because the USB device is a FAT filesystem and
that rsync doesn't know how to deal with the (pseudo) resource forks on
a FAT system. So I guess that CpMac really is the only command line
tool to do what you need.


-j
 >> Stay informed about: [Q]Copie dossier et Terminal 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> System All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]