non-stupid-digest-assets icon indicating copy to clipboard operation
non-stupid-digest-assets copied to clipboard

Use symbolic links in place of copying the whole files

Open hartator opened this issue 9 years ago • 2 comments

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.

hartator avatar Jun 24 '15 23:06 hartator

A good idea!

iRet avatar Jan 29 '16 09:01 iRet

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.

chewi avatar Mar 08 '16 16:03 chewi