Community discussions

Topic Author
Posts: 28
Joined: Thu Aug 16, 2012 2:59 pm

Why sometimes fails => /file remove [find]

Thu Jan 31, 2019 4:55 pm

I got a Script on some routers, with that command in it to erase all files. Its because small space on hAP lite and trying to upgrade the router.
/file remove [find]
It fails, mainly when exist the file "auto-before-reset.backup".
Done a simple script like this other, works where the other script doesn't:
:do {
  /file remove [find];
  log info "Remove Done";
} on-error={
  :log error "Failed to delete all";
Is there a reason why it fails? or a workaround to solve this issue?

EDIT: If manual erase "auto-before-reset.backup" the scripts works as expected.

User avatar
Forum Guru
Forum Guru
Posts: 1785
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: Why sometimes fails => /file remove [find]

Thu Jan 31, 2019 9:06 pm

find also returns directories. Some may be protected. Also depending on the order some of these directories may not be emtpy.

Who is online

Users browsing this forum: No registered users and 8 guests