Re: crontab schedule repeater announcements

I corrected earlier issues with not calling ann01.sh script from crontab. I can now cron into annun01.sh and ann01.sh works fine IF I say send a text to a file. 
echo "Hello World" >> test 

It errors with "can not open file" if the ann01.sh script is trying to run a command line command or "localplay" to run a recorded voice file.
asterisk -rx "rpt fun 42996 *970"                          
/usr/sbin/asterisk -rx "rpt fun 42996 *970"
 asterisk -rx "localplay 42996 /etc/asterisk/scripts/ann01"   

Thanks,
Duane


On Fri, Jan 27, 2017 at 12:00 PM, <app_rpt-users-request@lists.allstarlink.org> wrote:
Send App_rpt-users mailing list submissions to
        app_rpt-users@lists.allstarlink.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users
or, via email, send a message with subject or body 'help' to
        app_rpt-users-request@lists.allstarlink.org

You can reach the person managing the list at
        app_rpt-users-owner@lists.allstarlink.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of App_rpt-users digest..."

Today's Topics:

   1. Re: crontab schedule repeater announcements (David KE6UPI)


---------- Forwarded message ----------
From: David KE6UPI <dshaw@ke6upi.com>
To: Users of Asterisk app_rpt <app_rpt-users@lists.allstarlink.org>
Cc: 
Date: Fri, 27 Jan 2017 07:41:58 -0800
Subject: Re: [App_rpt-users] crontab schedule repeater announcements
Hello Duane, I would try this in crontab -e

* * * * * /etc/asterisk/scripts/announcements01.sh

David

On Fri, Jan 27, 2017 at 6:43 AM, DuaneVT . <selkie2@comcast.net> wrote:
I finally got to the root mail to see what errors crontab was finding with running this script. I have crontab calling ann01.sh script and the script is running. 
The ann01.sh and prompt01.gsm files are in /etc/asterisk/scripts. Both files and the scripts folder are set as executable.
The ann01.sh script is as below:

#!/bin/bash
# Script plays prompt01 audio files over local node (repeater)
# Runs "localplay prompt01.gsm via IAX or radio *970

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/sbin/asterisk/

/usr/sbin/asterisk -rx "rpt localplay /etc/asterisk/scripts/prompt01"  # error "can't open ann01"


sudo asterisk -rx "rpt fun 42996 *970"                             # error "can't open ann01"
asterisk -rx "rpt fun 42996 *970"                                      # error "can't open ann01"
/usr/sbin/asterisk -rx "rpt fun 42996 *970"                       # error "can't open ann01"
echo "Hello World" >> test                                               # runs fine!

---------------------------------------------
I can hit *970 on the radio and hear the localplay run the prompt01 speech.
I can type ann01 via ssh and the prompt01 is heard.
I just can't get the ann01.sh script to run from cron!

Help!
Duane KA1LM

_______________________________________________
App_rpt-users mailing list
App_rpt-users@lists.allstarlink.org
http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users

To unsubscribe from this list please visit http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users and scroll down to the bottom of the page. Enter your email address and press the "Unsubscribe or edit options button"
You do not need a password to unsubscribe, you can do it via email confirmation. If you have trouble unsubscribing, please send a message to the list detailing the problem.


_______________________________________________
App_rpt-users mailing list
App_rpt-users@lists.allstarlink.org
http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users