[p4] New script to manage proxy diskspace in public depot
Frank Compagner
frank.compagner at guerrilla-games.com
Mon Sep 17 01:39:50 PDT 2007
Hi,
I've just submitted a new script to manage the p4p diskspace usage
to the public depot. It's called p4p_clean.py, and you can find it at:
http://public.perforce.com:8080//guest/frank_compagner/
It's a Python script, works on both Linux and Windows, and is intended
to be installed as a cron job or a Windows scheduled task. I know
there are a few other scripts in the public depot already, but as we
have a number of proxies running on all kinds of hard and software,
I really needed one that:
1. Runs natively on both Windows and Linux.
2. Allows specifying the disk quota as percentage of total diskspace.
3. Sends out email when it has done something.
Run the script as follows:
p4p_clean.py -l low -h high -t address -m mailserver cache_path
The script will examine the disk the cache resides on, and check if the
percentage of free diskspace is below 'low'. If not, the script does
nothing. If it is, the script will sort all the files in the cache on
atime and proceed to delete the oldest files (by atime) until the free
diskspace is once again above 'high'. When done, it will mail a short
report to the specified address, using the specified mailserver. If an
error is encountered, this will be present in the mail.
This should ensure that the proxy cache remains nicely filled yet
never overflows the disk. The script has been running on a number of
our proxies (both Windows and Linux) for a couple of months now
without any problems. For more details, see the script itself.
----------------------------------------------------------------
Frank Compagner Guerrilla Games
More information about the perforce-user
mailing list