Web Hosting Talk







View Full Version : zipping default directory structures...


beglobal
02-07-2002, 12:18 AM
I need some assistance with commands to simplify some administration. I would like to install a predefined set of scripts and directories in a staging directory and then zip it up into one file. Then whenever I create a new site, I will just unzip the file into that site and make some minor configuration changes to the scripts. I will log in as the user who owns the site when I unzip the files, so if possible, I would like for it to assume ownership from that login. I would also like for all files to maintain their permissions.

Can anyone help me with the command or point me to a resource?

Thanks,
Johnathan

priyadi
02-07-2002, 04:32 PM
If you need to assume privileges of a user, a command like 'su' will do. But I'm not really sure if that's what you want.

zupanm
02-07-2002, 05:24 PM
tar cf dir.tar dir

that will keep all the file permissions plus the numbered userid and number id group id. So if you copy over say the /etc/passwd /etc/shadow and /etc/group before you untar the file to the new system it "should" keep all the same ownership and permissions.