I just set up a Perforce proxy server for work. I'm noticing the cache directory is filling up very quickly -- with files I know I will never need. For example, there is a 'sandbox' directory in the depot where users keep personal branches and other work; a p4 sync
is causing the p4 proxy cache to grab these user's sandboxes when I'll never need them. I would create a symbolic link for the sandbox directory to /dev/null
but then I wouldn't be caching my sandbox, which I am interested in.
Is there any way to tell the perforce proxy something to the effect of "if I haven't had to sync it, please don't cache it?"
I think there may be some misunderstanding of how Perforce RCS as well as the proxy works. I assume yyou are looking at the proxy cache on disk and seeing files from a portion of the depot or server that you don't expect to see? If so, check some of these files and I guarantee you'll find out that they were the source of an integration to the depot you are trying to sync. Unless you use the p4 snap command to undo all the lazy copies created during an integration this is 'by design.'
You can't tell the proxy not to cache files.
Here are some options:
Modify your client view to not include the directories that you don't want, then they'll never sync and wind up in cache. Everyone who uses your proxy will need to do the same thing to prevent the unwanted files from appearing in the cache.
Write a cron job that deletes the unwanted folders from the cache directory, and have it run hourly (or even more often if you desire). It's safe to delete files from p4p's cache while it's running.
Delete old files from the cache to keep it from growing without bound. There are scripts out there that can do this.
Add more disk space so that you don't have to worry about it :)
The proxy only caches what you request from the server, so if you "haven't had to sync it", it won't be cached. If you don't want the entire sandbox directory cached, don't sync the entire sandbox directory. Only sync what you need. It sounds like your doing this:
p4 sync //depot/sandbox/...
instead of this (let's say your sandbox directory is named fbrereto):
p4 sync //depot/sandbox/fbrereto/...