Ethernet Switching
Highlighted
Ethernet Switching

deleting multiple files

‎10-02-2019 09:41 PM

Hi all,

There is a number of files that are needed to delete. For instance messages, dhcp_trace, interactive-commands, default-log-messages etc...Each files has sub files as well...

How can be laveraged single(only one line) junos cli command to delete multiple files and its sub files? IS it possible on Junos rather then jumping to shell (%)?

For instance:

> file delete /var/log/message|interactive-commands|default-log-messages|dhcp-trace

6 REPLIES 6
Highlighted
Ethernet Switching

Re: deleting multiple files

‎10-02-2019 09:52 PM

 

Not in a single knob, use asterrisk after the file name to delete sub files.

 

For instance,

 

> file delete /var/log/interactive-commands*    << this will delete all interactive-commands files

 

/Karan Dhanak
Highlighted
Ethernet Switching

Re: deleting multiple files

‎10-02-2019 10:29 PM

What a shame...There is no way to delete multiple files with its sub files in a single junos cli (>file delete )!!!!!!!

 

I belieave it should be.... 

 

Highlighted
Ethernet Switching

Re: deleting multiple files

‎10-02-2019 10:43 PM
Hi Arix,

If you really need this feature, then you can follow up with your accounts team to open an enhancement request to include this feature in the next junos release.

Also doesn’t the command “request system storage cleanup “ help your case ? do you know of any other vendor which has similar feature that you are asking for ?

Regards,
Jibu
Highlighted
Ethernet Switching

Re: deleting multiple files

‎10-02-2019 10:47 PM

 

May be it should - but not just becuase you believe it should! You do have other options like "request system storage cleanup <dry-run>" that does clean up sub file but a whole. For individual ones, you have file name followed by asterisk to delete specfic file & its associated sub file.

 

 

/Karan Dhanak
Highlighted
Ethernet Switching

Re: deleting multiple files

‎10-02-2019 11:09 PM

hi there, thanks for reply.

Not looking for deleting all logs....

 

I have just noticed there is a way that can be leveraging:

>start shell sh command "cli -c 'file delete /var/log/message*;file delete /var/log/interactive*;file delete /var/log/dhcp_trace*;file delete /var/log/etc*'".  ------->I couldn't test it, but it should be working...Because My ex one has junos version 12 ...

This feature on junos versison 14 or later.

 

Highlighted
Ethernet Switching

Re: deleting multiple files

‎10-02-2019 11:19 PM

not from cli directly, works from the shell; good alternative though..

 

 

 

 

/Karan Dhanak