Asterisk Telegram -

Asterisk 1.4 , . , IP - ( ) . bash cron.


, . : . , reboot.sh:

[root@asterisk ~]# touch reboot.sh

vim :

[root@asterisk ~]# vim reboot.sh

, λ . , :

#!/bin/sh
LOGFILE=/home/admin/log_mail.txt
DATE="`date +%d.%m.%Y" "%H:%M:%S`"
echo "REBOOT :: $DATE :: Reboot is in progress" >> "$LOGFILE"
shutdown -r now
 Asterisk

:x! . :

  • LOGFILE - , ;
  • DATE - ;
  • echo "" - ;
  • shutdown -r now - ;

. . , cron:

*     *     *   *    *          
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +-----   (0 - 6) (=0)
|     |     |   +-------  (1 - 12)
|     |     +---------   (1 - 31)
|     +-----------  (0 - 23)
+-------------  (0 - 59)

. , crontab :

[root@asterisk ~]# crontab -e

:

0 0 * * 0 /bin/bash /home/reboot.sh >/dev/null

/home/reboot.sh - . F2 Yes. .


cron

, :

  1. 15 0 1 1,3,6,9,12 * - 1 , , , 00:15 ;
  2. 0 20 * 8 1-5 - 20:00 ;
  3. 0 0 1,15,25 * * - , ;

?

 .

P.S. , :)

"",