Community discussions

MikroTik App
 
conchalnet
Member Candidate
Member Candidate
Topic Author
Posts: 274
Joined: Thu Nov 03, 2005 1:44 pm
Location: Brazil

Remove all "auto.rsc" files via script

Mon Apr 13, 2009 4:41 pm

Hi all,

I'm interesting in remove all files that have the named finished by "auto.rsc" using a script.

I tried to use the * as a name mask but it didn't work.

I tried the follow forms:

/file remove "*auto.rsc"
:foreach i in=[/file find name="*auto.rsc"] do=[/file remove $i]

How can I solve this?

Thanks in advance

Fabrício
 
ayufan
Member
Member
Posts: 334
Joined: Sun Jun 03, 2007 9:35 pm
Contact:

Re: Remove all "auto.rsc" files via script

Mon Apr 13, 2009 4:56 pm

:foreach i in=[/file find] do={:if ([:typeof [:find [/file get $i name] "auto.rsc"]]!="nil") do={/file remove $i}}
 
conchalnet
Member Candidate
Member Candidate
Topic Author
Posts: 274
Joined: Thu Nov 03, 2005 1:44 pm
Location: Brazil

Re: Remove all "auto.rsc" files via script

Tue Apr 14, 2009 5:17 pm

thanks ayufan, it's the solution!

best regards!
 
ronaldoo
just joined
Posts: 18
Joined: Fri Aug 08, 2008 11:01 pm

Re: Remove all "auto.rsc" files via script

Fri Apr 17, 2009 8:33 pm

Hi all,

I'm interesting in remove all files that have the named finished by "auto.rsc" using a script.

I tried to use the * as a name mask but it didn't work.

I tried the follow forms:

/file remove "*auto.rsc"
:foreach i in=[/file find name="*auto.rsc"] do=[/file remove $i]

How can I solve this?

Thanks in advance

Fabrício

Thanks !