Open hartator opened 9 years ago
A good idea!
Apart from being a good idea, this also fixes a weird permissions issue I've seen. I deploy into an environment where we're not supposed to go in as a shared user so group writeable permissions are enforced. This works except for the line being discussed here. Only root or the owner of the file are allowed to modify the atime/mtime to anything other than the current time. If the file was initially created by someone else, it blows up with Operation not permitted. It doesn't matter than you're still allowed to modify or even delete the file itself. See man utime
for the formal explanation. Deleting the file first is one workaround and ln -sf
effectively achieves this. I have rebased the above commit against current master and it works fine.
Avoid copying the asset files using symbolic links. Should save both time when deploying and disk space on production severs. Shouldn't impact Nginx or Apache performance.