Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsLinux does not have one universal time when /tmp is emptied. On a system using the documented systemd defaults, systemd-tmpfiles removes files in /tmp after they reach 10 days old. Files in /var/tmp use a 30-day default. Cleanup is normally started by systemd-tmpfiles-clean.service, which is scheduled by systemd-tmpfiles-clean.timer.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
Those are policies, not a promise that every Linux machine behaves identically. Distribution settings, administrator overrides, boot-time rules, and whether /tmp is a volatile tmpfs mount can all change what survives. To know when a particular file will disappear, inspect that machine’s timer and tmpfiles.d rules.
As an Amazon Associate I earn from qualifying purchases.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →There is no Linux-wide clearing time
The name /tmp describes the intended purpose of the directory, not a single implementation. Linux distributions and administrators decide how temporary files are aged and removed. Some hosts use systemd’s systemd-tmpfiles; others may retain legacy cleanup tools or add distribution-specific jobs.
Even on two machines that both run systemd, the result can differ. A local rule may shorten or extend an age threshold, exclude a path, or request deletion during early boot. A mount configured as volatile can give /tmp a different lifetime from an ordinary directory on a persistent filesystem. Consequently, “after a reboot” is not a reliable general answer.
#1 Best Overall
- Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
- Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
- Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
- Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
- Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C
The documented systemd defaults
Upstream systemd documents these default ages:
| Directory | Documented default age | What the age means |
|---|---|---|
/tmp |
10 days | Files become eligible for age-based cleanup once the configured age is reached. |
/var/tmp |
30 days | Files are retained longer by default, but they are still temporary and policy-managed. |
The age is an eligibility rule, not a scheduled deletion at an exact wall-clock moment. The cleanup service must run, and the installed rules determine which files are considered. A file that reaches 10 days old may remain until the next cleanup pass; a local policy can remove it sooner or preserve it.
The systemd project states: “By default files in /tmp/ are cleaned up after 10 days, and those in /var/tmp after 30 days.” Treat that statement as the upstream baseline, then verify your host’s configuration.
How systemd-tmpfiles performs cleanup
The timer and service
systemd-tmpfiles-clean.timer schedules systemd-tmpfiles-clean.service. When the service runs, it invokes systemd-tmpfiles with cleanup behavior based on the active tmpfiles.d rules. The timer’s actual schedule is a property of your installation, so check it instead of assuming a particular hour or interval.
The rules in tmpfiles.d
Cleanup policy is assembled from files in the systemd tmpfiles.d search path. The usual locations are:
/etc/tmpfiles.d/for administrator-created overrides and site policy/run/tmpfiles.d/for rules generated at runtime/usr/lib/tmpfiles.d/for rules supplied by installed packages
Administrator rules in /etc/tmpfiles.d/ take precedence according to the installed configuration search order. A rule can set an age, create a directory, remove content at boot, or exclude a path from another cleanup rule. Reading only the vendor file in /usr/lib/tmpfiles.d/ can therefore give an incomplete answer.
Age-based and boot-time operations
The --clean operation cleans files and directories for which an age parameter is configured. Separately, systemd-tmpfiles has a --boot mode for rules intended to run during early boot. A file can therefore be affected by a boot rule even when it has not reached the normal age threshold.
Rank #2
- Solid state performance with up to 800MB/s read speeds in a portable drive. (Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
- Back up your content and memories on a storage solution that fits seamlessly into your mobile lifestyle.
- Take it with you on your adventures—up to two-meter drop protection means this durable drive can take a beating. (Based on internal testing.)
- Secure it to your belt loop or backpack for extra peace of mind thanks to the tough rubber hook.
- From Sandisk, a brand professional photographers trust to take on assignments.
Does /tmp get deleted on reboot?
Sometimes, but not as a universal rule. A normal persistent /tmp directory may keep a file across a restart until age-based cleanup runs. A host configured with a volatile /tmp mount can instead recreate the directory from an empty in-memory filesystem during boot, making its contents disappear when that mount’s lifetime ends.
Boot-time tmpfiles.d rules can also remove selected files or directories during early startup. In that case, the reboot is the trigger, but the rule—not a Linux-wide reboot guarantee—is responsible.
If a game launcher, compiler, archive tool, or script writes important data under /tmp, assume it can vanish while the system is running, during startup, or when a volatile mount is reset. Use a persistent application-specific directory for anything that must survive.
Why a file in /tmp disappeared
It crossed the configured age threshold
The most common explanation is ordinary age-based cleanup. Under the upstream systemd baseline, that threshold is 10 days for /tmp, but a local rule may use a different value. Cleanup does not need to wait for a reboot.
A scheduled cleanup pass ran
The timer may have launched the cleanup service while the machine was operating. If the system was powered off when a pass was due, the next service run after startup can process eligible files.
A boot rule matched the path
Rules with boot-time behavior can remove content during early startup. This is distinct from the normal age policy and is why inspecting only the 10-day default is insufficient.
Rank #3
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
The directory was volatile
If /tmp is mounted as volatile tmpfs, its contents have the lifecycle of that mount rather than a persistent disk directory. A restart, shutdown, or mount recreation can clear it.
An administrator or package supplied an override
Files in /etc/tmpfiles.d/, /run/tmpfiles.d/, or package-provided directories can change the result. A rule may target a subdirectory, alter the age, or explicitly exempt a path.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallA different cleanup mechanism is installed
Not every Linux host relies exclusively on the same systemd setup. Distribution tools, container images, desktop environments, or custom jobs can add cleanup behavior. If the systemd timer is inactive, look for the host’s other scheduled maintenance policies before drawing a conclusion.
How to check your machine
Run these checks as the account that administers the system. Reading status and configuration usually does not require root; applying a cleanup command can.
- Check whether the timer exists and when it last ran.
systemctl status systemd-tmpfiles-clean.timerLook for whether the timer is loaded and active, plus its last and next activation times.
- Display the timer schedule directly.
systemctl list-timers systemd-tmpfiles-clean.timerThis shows the schedule configured on your host. Do not substitute a remembered interval from another distribution.
Free tools Windows power users keep installed
One-click scans. No signup required.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.Rank #4
SaleSandisk 1TB Extreme Portable SSD, Up to 2000MB/s Transfer Speeds-New Model | External Solid State Drive, IP65 Water & Dust Resistant, Up to 3M Drop Protection, 256-bit AES Encryption, USB-C 3.2 Gen 2- NEARLY 2X FASTER THAN OUR PREVIOUS GENERATION(8) – move 1,000 high-res photos in under 60 seconds(6) with up to 2000MB/s transfer speeds(2).
- IP65 RATING AND UP TO 3M DROP PROTECTION(3) – protects against spills and drops.
- POCKET-SIZED – fits easily in pockets and small bags.
- SPACE TO OWN YOUR AI CONTENT – speed and capacity to download your high-res clips and photo edits.
- 256-BIT AES ENCRYPTION(4) – helps keep private files secure with password protection.
- Inspect the cleanup service.
systemctl status systemd-tmpfiles-clean.serviceA recent failure, a disabled unit, or an unusual last-run time can explain why eligible files remain or why cleanup happened unexpectedly.
- Review administrator overrides first.
ls -l /etc/tmpfiles.d/ /run/tmpfiles.d/ /usr/lib/tmpfiles.d/Read files that mention
/tmp,/var/tmp, or the subdirectory containing your file. The/etc/tmpfiles.d/directory is particularly important because local administrator policy takes precedence. - Read the installed manual for exact rule semantics.
man tmpfiles.dThe manual on your system explains the type field, age field, precedence, exclusion behavior, and boot processing supported by that version.
- Run cleanup only when you intend to apply policy.
systemd-tmpfiles --cleanThis applies configured age rules; it is not a harmless preview. Check the rules and protect needed files before running it on a production machine.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
After changing a configuration rule, restart systemd-tmpfiles-clean.service so safe runtime changes are applied as documented for the service. Verify the resulting status and inspect the target directory before relying on the new policy.
How to keep a file from being removed
Use persistent storage for persistent data
The safest fix is architectural: do not put irreplaceable data in /tmp. Store game saves, downloaded installers, build artifacts, logs that must be retained, and recovery material in a persistent application-specific directory with an intentional retention policy. /var/tmp is retained longer by the documented default, but it is still subject to cleanup and should not be treated as permanent storage.
Best Value
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Create a deliberate tmpfiles.d exemption
If a program must use a temporary path, create an administrator rule under /etc/tmpfiles.d/ that deliberately excludes the required path from the applicable cleanup rule. Use the tmpfiles.d manual on that machine to select the correct rule type and path scope; an exemption for a directory does not automatically protect unrelated locations.
Keep the exemption narrow. Protecting all of /tmp defeats its purpose and can allow unbounded growth. Restrict the rule to the application’s directory, document why it exists, and periodically review whether the application still needs it.
Change the application’s own temporary-directory setting
Many programs honor an environment variable or a configuration setting for temporary files. Point that setting at a persistent, quota-managed location only when the program’s documentation says it is supported. Moving a cache or scratch directory can affect permissions, performance, and privacy, so preserve the expected owner and access mode.
/tmp and /var/tmp are not interchangeable
| Question | /tmp |
/var/tmp |
|---|---|---|
| Upstream systemd default age | 10 days | 30 days |
| Safe for data that must never disappear? | No | No |
| Can local rules change retention? | Yes | Yes |
| Can boot or mount behavior affect contents? | Yes | Yes, depending on local configuration |
The longer default for /var/tmp is a retention preference, not a backup guarantee. A cleanup rule, package update, administrator override, or storage reset can still remove its contents.
Distribution-specific notes
Distribution release policies matter. Debian 13 release notes specifically warn that new installations regularly delete old files in both /tmp and /var/tmp while the system is running. That warning is a practical reminder not to depend on a reboot-only model and to move long-lived temporary data or add a carefully scoped exemption.
For any distribution, compare the cleanup mechanism, age threshold, timer state, boot-time rules, mount type, and local overrides. A distribution’s name alone cannot tell you the deletion time for one particular host.
A practical decision checklist
- Need the data after a restart? Keep it out of
/tmp, or verify that the path is persistent and exempted. - Need the data for more than 10 days? The upstream
/tmpbaseline is unsuitable; use persistent storage. - File vanished while the machine was running? Check the timer’s last activation and matching
tmpfiles.drules. - File vanished immediately after boot? Check for
--boot-related rules and whether/tmpis a volatile mount. - Timer is inactive? Investigate distribution-specific or administrator-created cleanup jobs.
- Planning to change policy? Review
man tmpfiles.d, make the smallest possible override in/etc/tmpfiles.d/, and verify service status afterward.
Bottom line
On an unmodified systemd installation, expect /tmp files to become eligible for cleanup after 10 days and /var/tmp files after 30 days. The cleanup normally runs through systemd-tmpfiles-clean.service and its timer, not solely at reboot. Because mount type, boot rules, distribution tools, and local overrides can change the result, inspect your timer and tmpfiles.d configuration before relying on any exact lifetime.
Quick Recap
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.




