How to Stop Ubuntu from Automatically Deleting Temporary Files on a Schedule

To help manage storage space and protect your privacy, Ubuntu features an automatic housekeeping utility. By default, it is configured to silently delete any files located in the “Trash” bin, as well as any temporary system files, that are older than 30 days. This happens automatically in the background on a schedule.

While this is great for system maintenance, many users treat the Trash bin as a secondary, temporary storage folder. If you frequently drag files to the Trash and rely on fishing them out weeks later, an automatic deletion schedule is a recipe for catastrophic data loss. You can disable this automatic housekeeping to ensure files are only deleted when you explicitly say so.

How to Stop Ubuntu from Deleting Temporary Files and Trash

You can turn off this scheduled deletion directly from the Privacy settings menu.

  1. Click the network/battery icon cluster in the top-right corner of the Ubuntu top bar and select Settings (the gear icon).
  2. In the left-hand navigation sidebar, scroll down and click on Privacy (or Privacy & Security).
  3. In the main window on the right, click on File History & Trash.
  4. Look for the section titled “Trash & Temporary Files.”
  5. You will see two distinct toggle switches: Automatically Delete Trash Content and Automatically Delete Temporary Files.
  6. Click both toggle switches to turn them completely Off.

Once disabled, Ubuntu will completely cease its background housekeeping. Files placed in the Trash will remain there indefinitely until you manually right-click the bin and select “Empty Trash.” Your temporary files will also persist, meaning you may need to occasionally clear them yourself if your hard drive starts running low on space.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.