Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Cleaning Up Files with the CLI

You can use the CLI request system storage cleanup command to rotate log files and delete unnecessary files on the device. If you are running low on storage space, the file cleanup procedure quickly identifies files that can be deleted.

The file cleanup procedure performs the following tasks:

  • Rotates log files—Archives all information in the current log files, deletes old archives, and creates fresh log files.
  • Deletes log files in /var/log—Deletes any files that are not currently being written to.
  • Deletes temporary files in /var/tmp—Deletes any files that have not been accessed within two days.
  • Deletes all crash files in /var/crash—Deletes any core files that the device has written during an error.
  • Deletes all software images (*.tgz files) in /var/sw/pkg—Deletes any software images copied to this directory during software upgrades.

To rotate log files and delete unnecessary files with the CLI:

  1. Enter operational mode in the CLI.
  2. Rotate log files and identify the files that can be safely deleted.
    user@host> request system storage cleanup

    The device rotates log files and displays the files that you can delete.

  3. Enter yes at the prompt to delete the files.

Note: You can issue the request system storage cleanup dry-run command to review the list of files that can be deleted with the request system storage cleanup command, without actually deleting the files.

Note:

On SRX Series devices, the /var hierarchy is hosted in a separate partition (instead of the root partition). If Junos OS installation fails as a result of insufficient space:

  • Use the request system storage cleanup command to delete temporary files.
  • Delete any user-created files in both the root partition and under the /var hierarchy.

Modified: 2016-07-01

Supported Platforms

Modified: 2016-07-01