Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Karatehero

macrumors member
Original poster
Jan 5, 2004
48
0
Pittsburgh
I hate the terminal. I know its the lifeblood to most mac/linux users, but I can't ever get it to work for me. I'm trying to do something so simple too.....

I have a server that died. Apple replaced it under warranty (I was most happy). I have my public folder and my users folder on my old server that I need to copy the files to my new server. I want to copy the public folder withOUT permissions and I will manually rebuild all ACLs (they got all fubared). I want to copy the users folder into the new macs' user folder and retain my acls.

I was told to do this with the terminal and CP. I was going to user Superduper and its nice 'preserve ACLs checkbox' but I'm not sure if it will work for me. Instead, I'm going to boot my new server into target disk mode (I've never done this - I assume is shows up under my mnt directory?) and connect it to the old server. I worked out 2 commands to run.

For copying public without ACLs:
cp -vR /oldserver/public /newserver/public
For copying users with ACLs:
cp -pvR /oldserver/users /newserver/users

(I realize I don't need the -v but its nice to see it working)

Right? Thing is, it copys the files in their containing folder into the new folder. So - I would end up with /newserver/public/public/.......

How do I tell it to copy my files into the directory and not into a directory in that directory?

On top of that, is there an easier way to do this? I looked at Rsync, but I woudl end up with 1000 switches, and I don't have files to merge - my destination is empty.

Thanks in advance!
 

belvdr

macrumors 603
Aug 15, 2005
5,945
1,372
I hate the terminal. I know its the lifeblood to most mac/linux users, but I can't ever get it to work for me. I'm trying to do something so simple too.....

I have a server that died. Apple replaced it under warranty (I was most happy). I have my public folder and my users folder on my old server that I need to copy the files to my new server. I want to copy the public folder withOUT permissions and I will manually rebuild all ACLs (they got all fubared). I want to copy the users folder into the new macs' user folder and retain my acls.

I was told to do this with the terminal and CP. I was going to user Superduper and its nice 'preserve ACLs checkbox' but I'm not sure if it will work for me. Instead, I'm going to boot my new server into target disk mode (I've never done this - I assume is shows up under my mnt directory?) and connect it to the old server. I worked out 2 commands to run.

For copying public without ACLs:
cp -vR /oldserver/public /newserver/public
For copying users with ACLs:
cp -pvR /oldserver/users /newserver/users

(I realize I don't need the -v but its nice to see it working)

Right? Thing is, it copys the files in their containing folder into the new folder. So - I would end up with /newserver/public/public/.......

How do I tell it to copy my files into the directory and not into a directory in that directory?

On top of that, is there an easier way to do this? I looked at Rsync, but I woudl end up with 1000 switches, and I don't have files to merge - my destination is empty.

Thanks in advance!

Here you go:

For copying public without ACLs:
cp -vR /oldserver/public/* /newserver/public

For copying users with ACLs:
cp -pvR /oldserver/users/* /newserver/users


Rsync wouldn't require a lot of switches either, but cp will work just fine:

rsync -av /oldserver/public/ /newserver/public

Once you boot the system into target disk mode, it will show up under /Volumes.
 

Karatehero

macrumors member
Original poster
Jan 5, 2004
48
0
Pittsburgh
Thank you 1000 times! I'm going to try and play with this and we'll see what happens. That makes some good sense though.

Can I ask you another question? When going through syncing and the such I keep coming across the term 'recursion'. I know that it means a function defining itself with its own definition, but how does that apply to syncing?

Thanks again!
 

belvdr

macrumors 603
Aug 15, 2005
5,945
1,372
Thank you 1000 times! I'm going to try and play with this and we'll see what happens. That makes some good sense though.

Can I ask you another question? When going through syncing and the such I keep coming across the term 'recursion'. I know that it means a function defining itself with its own definition, but how does that apply to syncing?

Thanks again!

Post that error message. I haven't seen a recursion error message with rsync.
 

Karatehero

macrumors member
Original poster
Jan 5, 2004
48
0
Pittsburgh
See, here is what gets me. I have 2 drives - Server HD and ExtServer. I want to copy the contents of the public folder on ExtServer into the Public folder on Server HD. I typed this:

fileserver-1:Server HD admin$ cp -vR /Volumes/ExtServer/Shared\ Items/Public/* /Volumes/Server\ HD/Shared\ Items/Public/

I get a bazillion errors back:

cp: /Volumes/ExtServer/Shared Items/Public/weekly kiln data: unable to copy extended attributes to /Volumes/Server HD/Shared Items/Public/weekly kiln data: Permission denied
/Volumes/ExtServer/Shared Items/Public/weekly kiln data -> /Volumes/Server HD/Shared Items/Public/weekly kiln data
cp: /Volumes/Server HD/Shared Items/Public/weekly kiln data/1010805.xls: No such file or directory

So, I guess:

1 - Do I need to run this as root or something?
2 - Obviously my files and directorys aren't there - I want to copy them in!

Can someone help me!!!!?????

EDIT - I needed to run it as root. That fixed it.
 

belvdr

macrumors 603
Aug 15, 2005
5,945
1,372
See, here is what gets me. I have 2 drives - Server HD and ExtServer. I want to copy the contents of the public folder on ExtServer into the Public folder on Server HD. I typed this:

fileserver-1:Server HD admin$ cp -vR /Volumes/ExtServer/Shared\ Items/Public/* /Volumes/Server\ HD/Shared\ Items/Public/

I get a bazillion errors back:

cp: /Volumes/ExtServer/Shared Items/Public/weekly kiln data: unable to copy extended attributes to /Volumes/Server HD/Shared Items/Public/weekly kiln data: Permission denied
/Volumes/ExtServer/Shared Items/Public/weekly kiln data -> /Volumes/Server HD/Shared Items/Public/weekly kiln data
cp: /Volumes/Server HD/Shared Items/Public/weekly kiln data/1010805.xls: No such file or directory

So, I guess:

1 - Do I need to run this as root or something?
2 - Obviously my files and directorys aren't there - I want to copy them in!

Can someone help me!!!!?????

EDIT - I needed to run it as root. That fixed it.

Yep, and in the future if you want to resync those directories, use rsync. It will run much much faster.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.