Score:0

Needing to free up space in the / directory in a perforce server. Cant rotate logs due to access set by p4 protect

US flag
Nick Mast

new to linux/ubunutu environments and currently helping do some admin work on a perforce server, needing to free up space on the / directory, read that rotating logs is the best way to do so.

Upon trying, I get "Access for user 'admin' has not been enabled by p4 protect. Any and all advice is greatly appreciated. Previously i had good luck using the "gzip" command to free up space, but now that too is filling up..

Score:0
US flag
Samwise

To answer the immediate question: if you have direct access to the server filesystem, you should be able to rotate the log by just moving the log file. (It's usually a file called log in the server root directory.) Obviously this will only free up space on the drive if you move it to another drive (i.e. wherever you keep your backups, which is hopefully not just another directory on the same physical drive). If you don't care about historical log data (and if you never look at your log anyway, there's no reason to), you can also just delete it. Either way, the server will just start a new log file the next time it has something to write to the log.

I'm doubtful that this on its own will buy you much time before the disk fills up again, since the log file is usually a pretty small fraction of overall disk usage (unless you've been running with extra verbose logging and it's been a very long time since the log has been truncated or rotated).

The main way to save space is going to be making sure that there isn't anything taking up space on the disk that's not part of what the actual server needs to operate. As I alluded to earlier, inexperienced admins will sometimes take regular checkpoints/backups but leave them all in the server root (which is where they're written by default if you don't specify a location for them) instead of actually moving them to backup storage; this is not only a giant waste of space, it largely defeats the purpose of backups (which is to allow you recover from something like a disk failure -- not much help if the backups are on the same failed disk). So if you're doing that, stop it, and that'll likely buy you some more time.

Another potential avenue of investigation is what's getting stored in the server -- are massive binary files getting checked in on a regular basis that don't actually need to be versioned? If so, obliterating old revisions and changing those files to +S storage might save some archive space.

Ultimately, though, if you've already eliminated all the obvious potential wastes of space, you're not going to be able to infinitely stretch a finite amount of disk space no matter how often you rotate your log file. Invest in disk space that's going to be adequate to store the amount of data that you're adding to your server in the course of normal operations.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.