![]() When you untar that tar file, the permissions are attempted to be retained. Where your $targetdir is the directory you are tarring up and $destTarFile is the name of the tar file you're creating. ![]() Reading the man page on chmod should provide details, but you could try this: cd $targetdir chmod -R u+rwX,a+rX. Most unix users don't like to set the permissions recursively because it sets the execute bit on files that should not be executable (configuration files for instance) to avoid this they invented a new way to use chmod some time ago, called symbolic mode. That way you're not letting the world write to your directories, which is generally advisable. You can easily change the permissions on the files prior to your tar command, although I generally recommend people NEVER use 777 for anything except /tmp on a unix system, it's more productive to use 755 or worst case 775 for directories. As I said originally, I could always create a copy of the dir, make the copy recursively writable and then tar up the copy dir, but the dir is fairly large, and disk space is sometimes near full (it can vary greatly), so making a copy of the dir will not be feasable 100% of the time. So, I figured I'd create a separate, recursively-writable version of the tar to distribute just to them. This leads to phone calls to me to diagnose a variety of problems where the root cause is that they forgot to do (or did incorrectly) the chmod'ing of the unrolled directory.Īnd before you ask, yes, I wrote them a script to untar/chmod (specific just for them), but. Even though they have instructions on the "how-to's" of the tarfile, they always seem to forget (or get wrong) the setting of the files to be recursively writable once untarred. This group is somewhat technically challenged. Most only need the read/execute permissions (and specifically DON'T want them writable), but one group in particular needs their copy to be recursively writable since they may edit these files, or even restore back to a "fresh" copy (i.e., in their original state as I gave them). A tarfile is created and distributed to multiple "customers" within our org. The root directory is in our ClearCase vob with specific file permissions, recursively. The clumsy way would be to make a copy of the directory, and then chmod -R 777 but I was wondering if there was a better solution. I would like the unrolled dir to be world writable without the users who are unrolling the tar to have to remember to chmod -R 777 before proceeding. Is there a way to chmod 777 the contents of a tarfile upon creation (or shortly thereafter) before distributing? The write permissions of the directory that's being tar'd is unknown at the time of tar'ing (but typically 555).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |