Hi All,
I need to move files from one directory to another where the directroy is allready created, without changing permissions of the second directory, and I need to do this with about 300 directories. Example, all my users are in /Homes/user1 /Homes/user2 etc.
I have a backup restored in /Homes/Restore/homes/user1, /Homes/Restore/homes/user2 etc.
The permissions on the folders in the restored files are not correct. the directories that I'm going to be copying to have the correct permissions.
Currently I can do a: mv -R /Homes/Restore/user1/* /Homes/user1/
that works fine. but I don't want to do that for each user.
I think I can use a for loop but don't know what syntax to use:
something along the line of:
for each directory in /Homes/Restore/
do mv -R /Homes/Restore/$current_iteration /Homes/$current_iteration
Can someone help?
Thanks.
Joe
I need to move files from one directory to another where the directroy is allready created, without changing permissions of the second directory, and I need to do this with about 300 directories. Example, all my users are in /Homes/user1 /Homes/user2 etc.
I have a backup restored in /Homes/Restore/homes/user1, /Homes/Restore/homes/user2 etc.
The permissions on the folders in the restored files are not correct. the directories that I'm going to be copying to have the correct permissions.
Currently I can do a: mv -R /Homes/Restore/user1/* /Homes/user1/
that works fine. but I don't want to do that for each user.
I think I can use a for loop but don't know what syntax to use:
something along the line of:
for each directory in /Homes/Restore/
do mv -R /Homes/Restore/$current_iteration /Homes/$current_iteration
Can someone help?
Thanks.
Joe