Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having problems with this script...It doesn't seem to work. Note: It sends email just fine.


#Reset the queue every morning at 5:00AM PST
#v 1.1 changed email

#Email alert that queue has been reset

asterisk -rx 'queue reset stats'
EMAILMESSAGE="Queue has been reset"
echo "$EMAILMESSAGE" | /bin/mail -s "$SUBJECT" "$EMAIL"
share|improve this question
does asterisk -rx 'queue reset stats' work when typed in the console? (assuming that's the line not working from your script). – m4573r Oct 4 '12 at 14:08
@m4573r Yes it does work manually typing on the console. – JoyIan Yee-Hernandez Oct 5 '12 at 12:01
So what's not working actually? Is it only when run by cron? Does it fail every time? Have you tried other schedules? Have you tried to run the script manually at the same time that your crontab would run it? – m4573r Oct 5 '12 at 12:16
@m4573r Ran the script manually and it this is really getting weird and interesting....the script is owned by root and the permissions seem to be fine...-rwxr-xr-x 1 root root Any inputs? – JoyIan Yee-Hernandez Oct 9 '12 at 14:47
Well, not really... You should be sure the script is executed, to see if that's the problem or if it comes from the asterisk. In case it does, you should try to log the result of the command see what's causing the error... – m4573r Oct 9 '12 at 14:52

You must log in to answer this question.

Browse other questions tagged .