Ethernet Switching
Highlighted
Ethernet Switching

deleting log files

‎10-01-2019 04:23 AM

Hi all,

Some reasons the logs that the branch srx generated are needed to be deleted. Which Junos cli is it needed to perform and which log files? and how to verify?

5 REPLIES 5
Highlighted
Ethernet Switching

Re: deleting log files

‎10-01-2019 04:30 AM

 

try this:

 

> file delete /var/log/test    <<< file name test being the sample file logs

 

or from the shell:

 

> start shell
% su
Password:
re0:/var/home/labroot # rm -rf /var/log/<filename>

 

 

 

 

 

/Karan Dhanak
Highlighted
Ethernet Switching

Re: deleting log files

‎10-01-2019 04:32 AM

hi,

Are you looking for storage cleanup ? 

(SRX Series)

request system storage cleanup
<dry-run>
<no-confirm>
<re0 | re1 | routing-engine (backup | both | local | master | other)>

 

https://www.juniper.net/documentation/en_US/junos/topics/reference/command-summary/request-system-st...

 

Thank you

Prabin

Highlighted
Ethernet Switching

Re: deleting log files

‎10-01-2019 05:32 AM

storage cleanup? This is another thing!... When doing storage cleanup, is this deleting all log files that junos generated?

 

Just imagine, you are selling your ex/srx devices to another company as second hand. Of course default/original configuration must be loaded before handover . I do understand this. No problem.

But my question is how to make sure the logs or log files are deleted before handover? and how to double verify this?

 

Highlighted
Ethernet Switching

Re: deleting log files

‎10-01-2019 05:39 AM

In that case, I would suggest to perform a system zeroize & followed by factory-defaults

 

https://www.juniper.net/documentation/en_US/junos/topics/reference/command-summary/request-system-ze...

 

 

 

/Karan Dhanak
Highlighted
Ethernet Switching

Re: deleting log files

‎10-01-2019 05:54 AM

Hi,

 

You can use "request system storage cleanup dry-run" this will list out the logs and the files which it will remove

Then you can use "request system storage cleanup" to  clean them

Again you can run the dry-run command to check if any logs and file left out 

cleanup  command will not remove the configurations

 

Another option would be to system zerioze, which will wipe out everything then you can apply the basic configuration 

 

https://www.juniper.net/documentation/en_US/junos/topics/reference/command-summary/request-system-ze...

 

Method confirm if any log files are present would be check "file list /var/log" path where by default all the log files are stored

 

thank you

Prabin