Link to home
Start Free TrialLog in
Avatar of dougp23
dougp23Flag for United States of America

asked on

Some script help

Hi all.

I need a script I think to do this!  
We rolled out a Samba server, and used roaming profiles.  Big mistake.  So, now I want to undo roaming profiles, but have people's stuff they saved (under My Documents) transferred to their home dir.  I have about 400 accounts.  So something like this:

cp /opt/profiles/{username}/My Documents/* /home/{username}

so that way /op/profiles/JOhn1/My Documents/* would copy to /home/John1 and John2 would copy to /home/John2 etc etc ( the usernames are not sequential).

Any help would be cool!

Thanks.

Doug
SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dougp23

ASKER

so i wrap this in a file, make it executable and then just run it?
yes?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Eee, just wonder: why joshgooding's answer was accepted, while it was rewriten word by word from mine ?
Avatar of joshgooding
joshgooding

Hi Guys,

Yep your right ravenpl, i just added what you had written to and added a couple of extra lines to answer dougp23's next question

You where right, so points should be yours =)
joshgooding: no offence to You, You added few info, and earned some points, hence the author made big bloomer...