Search code examples
unixshared-directorypublic-html

Unix folders - where to put intermediate files and results when running a script


I have written a script that checks out some files from a repository, operates on them in some way and produces a result file in html.

I would like all users to be able to run the script and view the results independently. This includes one user running the script and another viewing the results.

From my limited understanding of the Unix folder structure I believe I should put the script itself in /usr/local/bin.

My question is where should I put the files that are checked out from the repo and the results? Should they go in sub-folders of /usr/local, and if so, is there a standard practice I should be following? Or should I put them somewhere else entirely?


Solution

  • /usr/local is a poor choice for your temp files as indicated by the others.

    You may choose to put the script under the /usr/local/bin, but do not extract or process your files under /usr/local.

    You can probably choose /tmp or a separate folder under the the user's home directory (example: /home/username/appname) to place those files instead.

    Hope this helps.