login Signup

Why does my temp directory have lots of par-* directories?

I'm using ElectricAccelerator and noticed that over time there are lots of directories named par-USERNAME where USERNAME is one of the users at my company. Where are those coming from? Is it safe to delete them?

avatar image By thedude 274 asked Aug 07, 2018 at 09:01 PM
more ▼
(comments are locked)
10|750 characters needed characters left

1 answer: sort voted first

The short answer is:

The par-* directories are created as a side-effect of using cmtool. They contain cached data that is used to improve startup time for cmtool. It is safe to delete them, though doing so will make the next invocation of cmtool a bit slower for each user whose cache directory is removed.

The long answer is:

In many versions of ElectricAccelerator, cmtool is distributed as a wrapped Perl executable, created using the Perl Packager utility. When such an executable is invoked, the packager framework automatically extracts the content of the wrapped executable, including libraries and modules that it requires, into a temporary directory unique to the user that invoked the executable. Depending on the exact version of the Perl Packager, the temporary directory may be named as par-USERNAME where USERNAME is the literal username of the user, or the directory may be named as par-hex(USERNAME), where hex(USERNAME) is a hexadecimal encoding of the username (which protects against locale / internationalization issues).

Typically these directories are not removed when the executable exits, but instead remain on the filesystem so that subsequent invocations of the executable by the same user can startup faster since they need not redo the extraction process. Most deployments of ElectricAccelerator have a relatively small number of distinct users that use cmtool, so this strategy works very well.

In very rare cases, users have reported that the accumulation of these cache directories over time causes disk space shortages. In those cases this is a consequence of having many, many distinct users invoking cmtool. To cope with the accumulation of these directories, you may employ any of the following strategies:

  1. Carefully assess your usage of cmtool. Typically cmtool is used by system adminstrators, a relatively small number of distinct users, rather than by end users themselves, which is usually a much larger pool of users. In most cases it is not necessary for end users to use cmtool.

  2. If cmtool is invoked by an automated process (such as an ElectricFlow procedure), follow the cmtool invocation with an explicit call to delete the cache directory after cmtool exits.

  3. If cmtool is invoked by an automated process, arrange for it to be invoked by a single service user account, rather than by each user that invokes the automated process.

  4. Setup a regularly scheduled task to delete cache directories that have not been accessed for 24 hours or more, for example using cron or ElectricFlow.

avatar image By eric melski ♦♦ 6k answered Aug 07, 2018 at 09:21 PM
more ▼
(comments are locked)
10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.