#!/bin/bash # this is to erase the logs. Set to your full log file >/var/log/openpbx.org/full #remove the old file if exists rm -f /var/spool/openpbx.org/outgoing/aaa TO=`date +%N` #aa is the file to be copied cp aa aaa chown openpbx:openpbx aaa #MOVE and not COPY the new file mv aaa /var/spool/openpbx.org/outgoing/$TO #mv aaa /opt/openpbx.org/var/spool/outgoing/$TO echo $TO # Be sure that openpbx can access the file to be sent.