Do you know how can I set permissions beforehand for a folder that I want to upload on a linux server? I'm working on a piece of software (php/mysql) on my local windows machine, I then tar the folder and upload it to my ubuntu web server. When I untar the contents, all the files and folders have automatically 777 permissions. Can I change that some way?
Answer
Since Windows does not have Unix-style permissions, tar-ing up files on Windows will not result in usable Unix permissions when it is unpacked on a Unix system.
When creating, use --mode to set a specific mode.
When unpacking, use --no-same-permissions to ignore the stored permissions and use the current users' umask.
man tar :)
No comments:
Post a Comment