Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteFor one application directory in /tmp, add a narrowly scoped X rule in /etc/tmpfiles.d/ to exclude that subtree from age-based cleanup, then review the configuration and run a dry run. If files must survive a reboot, do not try to preserve them in /run: move them to /var/tmp or the application’s persistent state location instead.
First decide how long the files need to last
The right fix depends on whether the files are disposable temporary data, runtime state for this boot, or data the application must retain. The Filesystem Hierarchy Standard (FHS) distinguishes these locations by purpose:
As an Amazon Associate I earn from qualifying purchases.
| Location | Intended lifetime | Practical implication |
|---|---|---|
/tmp |
Temporary files. Programs must not assume files survive between invocations. The FHS recommends clearing its contents at boot, but this is a recommendation, not a requirement. | Use an exclusion only when temporary data genuinely needs protection from a cleanup rule on this system. FHS: /tmp |
/run |
System information and runtime state since boot; it must be cleared at the beginning of boot. | Do not use it for data that must survive reboot. FHS: /run |
/var/tmp |
Temporary files intended to be preserved between reboots; the FHS says they must not be deleted at boot. | Prefer it when the data is temporary but needs to outlast a reboot. FHS: /var/tmp |
| Application-specific persistent storage | Non-temporary application state. | Use the location appropriate to the application and system layout rather than making a temporary directory permanent. |
These FHS lifecycle rules describe the directories’ purposes; they do not prove that a particular distribution deletes files using a particular systemd-tmpfiles rule. Check the affected host’s configuration before changing it.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
How systemd-tmpfiles decides what to clean
systemd-tmpfiles creates, removes, and cleans paths according to tmpfiles.d configuration. Age-based cleanup applies to entries with an age parameter; there is no universal cleanup interval to assume. The active rule depends on the installed distribution and its local configuration. See the systemd-tmpfiles manual and the tmpfiles.d manual, and check the versions installed on the machine.
#1 Best Overall
The x rule type ignores one path during cleaning; X ignores a path recursively. For an application subtree, X is the documented type to consider. A representative line is:
X /tmp/my-application - - - -
Replace /tmp/my-application with the exact directory. Confirm the fields and rule behavior against the local tmpfiles.d(5) manual and the other rules present on the host before relying on it.
Rank #2
Add a targeted exclusion for a /tmp subtree
- Identify the exact path and when it disappears. Determine whether deletion happens during boot or periodic cleanup. Confirm that the files are genuinely temporary and that preserving them in
/tmpis the intended design. - Find the rule that affects it. Inspect the host’s tmpfiles configuration and identify the relevant vendor rule or local configuration. Vendor files and overrides vary by distribution.
- Create an administrator-owned rule. Put a narrowly scoped exclusion in a file under
/etc/tmpfiles.d/, using a name that does not unintentionally replace a vendor file. For example, a file named/etc/tmpfiles.d/my-application.confcould contain the representativeXline above. Follow the local manual for supported syntax and rule ordering. - Review the prospective cleanup without deleting files. Use
systemd-tmpfiles --clean --dry-runto inspect prospective operations. The exact command options and output can depend on the installed systemd version; consult the local manual. - Apply the change according to the local manual. The systemd-tmpfiles manual says to restart
systemd-tmpfiles-clean.serviceafter changing cleanup configuration so settings that can safely take effect at runtime are applied. Verify service behavior on the installed system before doing so.
A recursive exclusion protects the selected subtree from cleanup; keep its scope as small as the application allows. Avoid changing broader cleanup policy when a path-specific rule addresses the problem.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11When a vendor cleanup file needs to be disabled
Administrator configuration in /etc/tmpfiles.d/ takes precedence over a file in /usr/lib/tmpfiles.d/ or /run/tmpfiles.d/ when the filenames match. The documented way to disable an entire vendor-supplied configuration file is to create a same-name symlink under /etc/tmpfiles.d/ pointing to /dev/null. That disables the whole file, not just one path, and may affect other cleanup entries. Prefer a targeted exclusion when it is sufficient.
Rank #3
Why an exclusion cannot make /run survive reboot
/run is for runtime information describing the system since it booted, and the FHS requires it to be cleared at boot. A cleanup exclusion is not a sound way to turn it into persistent storage. Put reboot-persistent temporary files in /var/tmp; put non-temporary application state in the application’s persistent location.
Quick Recap
Best Value
Troubleshoot a deletion without guessing
- Pin down the lifecycle: record the exact path and whether the loss occurs at boot or later.
- Inspect the installed configuration: vendor rules and local overrides are machine-specific; identify the actual rule rather than assuming a default age or schedule.
- Check local documentation: consult
tmpfiles.d(5)for supported rule types and ordering on that system. - Use a dry run before applying a cleanup change: review the prospective operations with the documented dry-run option.
- Reconsider the storage location if reboot survival is required: use
/var/tmpfor temporary data or application-appropriate persistent storage for retained state.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




