<div dir="ltr"><div><div><br>On Thu, May 21, 2015 at 11:01 AM, William Hargrove <<a href="mailto:hnw@geobabble.org">hnw@geobabble.org</a>> wrote:<br>><br>> This is for old GRASS codgers like me who run GRASS commands *outside* the GRASS shell, by setting all of the environment variables.<br>><br>> This is the way that we change active mapsets as well.<br>><br>> I do this to have all of the *nix commands integrated seamlessly with GRASS commands.<br>><br><br></div>Hi Bill,<br><br></div>it's good to have this feedback.  I understand what you are doing but I'm not sure about the details.<br><div><div> <br>><br>> If a particular GRASS command aborts or dies, the temp files in the .tmp directory are left behind.<br>><br>> Since we never run the shell, .tmp is never deleted, and they build up, eating disk space.<br>><br><br>So you are using clean_temp in your scripts?<br> <br>><br>><br>> This thread is also germane with respect to the current discussion of GRASS environment variables.<br>><br>> Currently I shift between GRASS 6 and 7 by sourcing an alternative .bashrc file that makes use of the strippath function to clean GRASS 6 stuff from the existing paths ...<br>><br>> Please don't eliminate env variables or alter them too significantly ...<br><br></div><div>It would be best if you send the scripts and .bashrc you are using. If you have there too much private stuff and you don't want to clean it, please send it to me, I'll should be able to understand. It's hard to tell which parts of interface people are actually using (or what they consider as an interface). The actual code is thus necessary.<br></div><div><br></div><div>Note also that there is a new interface (in trunk) which removes the need for setting up the (fake) GRASS session manually [1]. But changes to user's scripts are needed. <br></div><div><br>[1] <a href="https://trac.osgeo.org/grass/ticket/2579#comment:14">https://trac.osgeo.org/grass/ticket/2579#comment:14</a><br><br>> Thanks,<br>><br>> Bill H.<br>><br>><br>><br>> On 05/21/2015 04:45 AM, Glynn Clements wrote:<br>>><br>>><br>>> Vaclav Petras wrote:<br>>><br>>>> when I was working on grass.py I saw there usage of clean_temp function<br>>>> which calls clean_temp program and deletion of the whole .tmp directory and<br>>>> I can't make sense out of it.<br>>>><br>>>> It seems to me that clean_temp (lib/init/clean_temp.c) executable called in<br>>>> grass.py is not necessary because the whole .tmp directory is anyway<br>>>> deleted at the beginning and at the end of the session. clean_temp is doing<br>>>> some special cleaning according to pids but whole directory is deleted<br>>>> anyway at the end. Can the whole lib/init/clean_temp.c can be safely<br>>>> removed? Or maybe it has some meaning when executed before the session<br>>>> starts because at that point .tmp is not deleted. Can someone please<br>>>> clarify this for me here or in the source code?<br>>>><br>>>> Also, the clean_temp function is called manually while other cleanups are<br>>>> called using at exit mechanism. Supposing we need the clean up at all, I'm<br>>>> not sure if there is any reason to keep it explicit. Perhaps this was just<br>>>> inconsistency, not an intention.<br>>><br>>><br>>> clean_temp is more restrictive in what it will remove (only files<br>>> owned by the current user, only files older than 4 days).<br>>><br>>> The original rationale for this behaviour is probably forgotten, and<br>>> it's unclear if it's still valid (probably not, if the startup script<br>>> is removing the entire directory at the end of the session and no-one<br>>> has complained).<br>>><br>><br>> --<br>> William W. Hargrove<br>> Eastern Forest Environmental Threat Assessment Center<br>> USDA Forest Service<br>> Southern Research Station<br>> 200 WT Weaver Boulevard<br>> Asheville, NC  28804-3454<br>><br>> (828) 257-4846<br>> (865) 235-4753 (cell)<br>> (828) 257-4313 (fax)<br>> <a href="mailto:hnw@geobabble.org">hnw@geobabble.org</a><br>> <a href="http://www.geobabble.org/~hnw">http://www.geobabble.org/~hnw</a><br>> _______________________________________________<br>> grass-dev mailing list<br>> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>> <a href="http://lists.osgeo.org/mailman/listinfo/grass-dev">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br><br></div></div></div>