Hi community,
Someone knows how to remove all tasks with cli comand?
I try all these in terminal:
/system scheduler remove all
/system scheduler remove *
/system scheduler remove numbers=“all”
/system scheduler remove
But they don´t work. Someonw help?
Thx for any help…
fewi
December 7, 2010, 7:45pm
2
When trying to act on several items in the CLI you want to first use a ‘find’ command to return all the items you need to match, and then act on that array of items. ‘find’ without parameters finds ALL items.
Therefore:
/system scheduler remove [/system scheduler find]
Thx a lot fewe. It´s work fine. Thx. Very goog help.
Hello again Fewi!
And with API?
I try this but don´t work:
$API->write('/system/scheduler/remove/[/system/scheduler/find]');
$API->read();
Result:
Connection attempt #1 to 111.111.111.111:1111...
<<< [6] /login
>>> [5/5 bytes read.
>>> [5, 39] !done
>>> [37/37 bytes read.
>>> [37, 1] =ret=8e70ec07dc95c657be45685a8e6ebfcd
<<< [6] /login
<<< [11] =name=admin
<<< [44] =response=0093c375afcbb616b826aaaadec13008b0
>>> [5/5 bytes read.
>>> [5, 0] !done
Connected...
<<< [12] /user/remove
<<< [10] =.id=manut
>>> [5/5 bytes read.
>>> [5, 1] !done
<<< [49] /system/scheduler/remove/[/system/scheduler/find]
>>> [5/5 bytes read.
>>> [5, 40] !trap
>>> [31/31 bytes read.
>>> [31, 8] =message=no such command prefix
>>> [5/5 bytes read.
>>> [5, 1] !done
Disconnected...
and this to:
$API->write('/system/scheduler/remove/system/scheduler/find');
$API->read();
result:
Connection attempt #1 to 192.168.200.221:8728...
<<< [6] /login
>>> [5/5 bytes read.
>>> [5, 39] !done
>>> [37/37 bytes read.
>>> [37, 1] =ret=2d9bb7ac7d71bda98e2704acaa796222
<<< [6] /login
<<< [11] =name=admin
<<< [44] =response=004c10dd88bbf84192194eafda7484e34b
>>> [5/5 bytes read.
>>> [5, 1] !done
Connected...
<<< [46] /system/scheduler/remove/system/scheduler/find
>>> [5/5 bytes read.
>>> [5, 40] !trap
>>> [31/31 bytes read.
>>> [31, 8] =message=no such command prefix
>>> [5/5 bytes read.
>>> [5, 1] !done
Disconnected...
I don´t know if the best way, but work:
$API->write('/system/scheduler/print', false);
$API->write('=.proplist=.id');
$tarefas = $API->read();
foreach ($tarefas as $tarefa):
$API->write('/system/scheduler/remove', false);
$API->write('=.id='.$tarefa['.id']);
$API->read();
endforeach;
Thx all community.
it’s the only right way =)
Thx Chupaka to confirm. Is glad to see you again.