3 #if [ -f /tmp/source/configuration ] ; then
4 # source /tmp/source/configuration
5 #elif [ -f /etc/planetlab/plc_config ] ; then
6 # source /etc/planetlab/plc_config
8 # PLC_MONITOR_HOST=IPADDR
10 #if [[ -z "$PLC_MONITOR_HOST" || "$PLC_MONITOR_HOST" = "localhost.localdomain" ]] ; then
11 # PLC_MONITOR_HOST=monitor.planet-lab.org
13 if [ -f /etc/planetlab/plc_config ]; then
14 source /etc/planetlab/plc_config
19 export MYOPS_SERVER=IPADDR
21 function upload_log ()
25 base=$( basename $file )
29 if [ ! -f $file ] ; then
38 #comm -1 -3 $old $new > $log
40 if [ $( stat -c %s $log ) -ne 0 ] ; then
41 curl --max-time 60 --silent http://${MYOPS_SERVER}/upload.php --form "log=@$log"
42 if [ $? -ne 0 ] ; then
43 # the upload has failed, so remove new file so no data is lost
44 rm -f /tmp/$( basename $file ).new
49 function upload_logs ()
51 upload_log $1 multiops
54 upload_logs /home/${PLC_SLICE_PREFIX}_myops/myops.log