Using Sublime Text 2, I sometimes have to edit shell files that are executed by bash in a cron. However, when I save these files, the execute flag is being removed from the file, causing the cron to fail when trying to execute the file. I have to chmod the file every time I change it. Previously, using Ultra-Edit, I never had this issue.
Has anyone else dealt with this issue who can recommend a fix or solution?
Assuming you are editing files through Samba, Sublime Text seems to recreate the file every time it saves it, with the default umask, and not preserve the old permissions.
The workaround to get +x permissions is to set
create mask = 755
in your Samba's smb.conf file in the relevant share section.
The downside, every new file will have +x now.
This problem can be fixed by disabling the map_archive
feature of samba.
[global]
map archive = no
This should solve the problem.
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With