Cron to reset Queue Stats

I’m trying to create a cron job to reset queue stats weekly, but keep getting this output when the job runs.

Output from command asterisk -r -x queue reset stats 601 …

No such command ‘queue’ (type ‘core show help queue’ for other possible commands)

Now if i connect to asterisk and run “queue” or queue reset" i get the same error, but “queue reset stats” completes… thus “queue reset stats 601” works and has the intended result.

I’m sure the PICNIC … what am i doing wrong?
(I’m creating the job with webmin fyi)

Are you enclosing the command in quotes?

asterisk -rx “queue reset stat”

Actually it’s single quote and only one dash as Alan points out. The double quotes may work but I have always seen singles used.

They all work ( single/double quotes and single/double dashes ). They are needed because asterisk expects the command to be executed to be contained in a single argument ( it should be more flexible, check tcpdump behavior for example). As long as you are escaping\quoting spaces you are fine. E.g:

# asterisk -rx database' 'show or even without any quotes # asterisk -r -x database\ show

You should read “Bash Guide for Beginners”:

I knew it was a lack of understanding on my part.

asterisk -r -x ‘queue reset stats 601’ did the trick!