GBROWSE_CLEAN(1p)
πΈ GBROWSE_CLEAN π
okay bestie, gather round, because today we're talking about gbrowse_clean.pl β the little cleanup crew that tidies up your sessions and all the other temporary gbrowse2 files. yes, it's a perl script. yes, it's iconic. let's go β¨
β¨ SYNOPSIS β¨
Run it from the command line like this, fr fr:
sudo -u www-data gbrowse_clean.pl
and literally just swap out www-data for whatever your web server account is actually called on your system. that's it. that's the whole vibe check π«Ά
If you want it to run automatically under cron (and bestie, you do), make a crontab file for the web server user with a line like this in it:
# m h dom mon dow command
5 0 * * /usr/bin/gbrowse_clean.pl >>/var/log/gbrowse2/gbrowse_clean.log
midnight-ish cleanup, logging to a file, main character energy only π
π OPTIONS π
-verboseβ spill the tea on everything it does: it prints out each and every session, file and directory it deletes. no secrets, full transparency π-helpβ prints a short help message and then dips out. exits immediately, no small talk.-manβ prints the manual page (hi, that's this one π) and exits.
π¦ DESCRIPTION π¦
so here's the situation: GBrowse2 is out here generating a whole bunch of temporary files while it's doing its thing. we're talking session data, data cache files, temporary image files, and user upload data from custom tracks. it adds up. it gets messy. π
This script expires those temporary files, which frees up all that unneeded space. and it's not just winging it β it honors these options from the GBrowse.conf master configuration file:
Name Default Description
---- ------- -----------
exire session 1M How long to keep session data
expire cache 2h How long to keep cache data
expire uploads 6w How long to keep user track data
Time intervals are given as a count plus a unit, like so:
Suffix Time Unit
------ ---------
s seconds
m minutes
h hours
d days
w weeks
M months
y years
now let's break each one down, because the details matter bestie π§
expire session controls how long it takes before user session data expires. once a session expires, the user's saved settings get purged β think their preferred data source, their track visibility settings, and their custom track uploads. and here's the cute part: the expiration interval is measured from the last time the user accessed their session, so simply loading a region in the browser without changing any settings is enough to keep a session from expiring. lowkey generous ngl πΈ
expire cache controls how long before cached track data gets purged from the system. caching for up to a few hours increases performance, because users reload the same region all the time. but caching for longer periods increases the time between updating the database and the tracks actually showing those changes. so like, there's a tradeoff. pick your fighter β
expire uploads controls how long user uploaded data for custom tracks stays on disk. it makes sense to keep it on disk for as long as β or longer than β the session. and even if the user's session expires, they can still get at the uploaded data if they bookmarked their session or shared the uploaded track at any point. so it's not gone-gone. slay π
This script should be run periodically, ideally under cron. once per day should be adequate for most uses, but heavily-used sites may wish to run the script more frequently.
and this part is important, so listen up: it is critical to run the script under the same user account as the web server. otherwise the script will be unable to delete the files created by the web server user during gbrowse execution. like, it literally cannot do its job. also β and I cannot stress this enough β do not run this script as root. just don't. periodt π
π AUTHOR π
Lincoln D. Stein <lincoln.stein@gmail.com> β Copyright 2009 Ontario Institute for Cancer Research
This script is available under either the GNU General Public License or the Perl Artistic License version 2.0. See LICENSE in the GBrowse source code distribution for the details.
π SEE ALSO π
and that's the whole page, bestie! π this one's from perl v5.40.0, dated 2024-10-20, and it lives in the GBROWSE_CLEAN(1p) section of the manual. go forth and clean up those temp files, you've got this π β¨π¦
π¦ where this page comes from
- ubuntu questing: gbrowse 2.56+dfsg-12build4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms