Changeset e977365


Ignore:
Timestamp:
08/13/13 06:25:13 (16 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
27f03ba
Parents:
ac48c86
Message:

Update log file locations and create a new send / recv log

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/lpreserver/backend/functions.sh

    rac48c86 re977365  
    1616CMDLOG2="${DBDIR}/lp-lastcmdout2" 
    1717REPCONF="${DBDIR}/replication" 
    18 LOGDIR="/var/log" 
    19 export DBDIR LOGDIR PROGDIR CMDLOG REPCONF 
     18LOGDIR="/var/log/lpreserver" 
     19REPLOGSEND="${LOGDIR}/lastrep-send-log" 
     20REPLOGRECV="${LOGDIR}/lastrep-recv-log" 
     21export DBDIR LOGDIR PROGDIR CMDLOG REPCONF REPLOGSEND REPLOGRECV 
     22 
     23# Create the logdir 
     24if [ ! -d "$LOGDIR" ] ; then mkdir -p ${LOGDIR} ; fi 
    2025 
    2126MSGQUEUE="" 
     
    242247  if [ "$2" = "sync" -a "$TIME" = "sync" ] ; then 
    243248     export DIDREP=1 
    244      echo_log "Starting replication SYNC task on ${DATASET}" 
     249     echo_log "Starting replication SYNC task on ${DATASET}: ${REPLOGSEND}" 
    245250     queue_msg "`date`: Starting replication SYNC task on ${DATASET}\n" 
    246251     start_rep_task "$LDATA" 
     
    249254     # Ready to do a scheduled replication 
    250255     export DIDREP=1 
    251      echo_log "Starting replication SCHEDULED task on ${DATASET}" 
     256     echo_log "Starting replication SCHEDULED task on ${DATASET}: ${REPLOGSEND}" 
    252257     queue_msg "`date`: Starting replication SCHEDULED task on ${DATASET}\n" 
    253258     start_rep_task "$LDATA" 
     
    283288 
    284289  # Start up our process 
    285   $zSEND 2>${CMDLOG} | $zRCV >${CMDLOG2} 2>${CMDLOG2} 
     290  $zSEND 2>${REPLOGSEND} | $zRCV >${REPLOGRECV} 2>${REPLOGRECV} 
    286291  zStatus=$? 
    287   queue_msg "ZFS SEND LOG:\n--------------\n`cat ${CMDLOG}`\n\n" 
    288   queue_msg "ZFS RCV LOG:\n--------------\n`cat ${CMDLOG2}`\n\n" 
     292  queue_msg "ZFS SEND LOG:\n--------------\n`cat ${REPLOGSEND}`\n\n" 
     293  queue_msg "ZFS RCV LOG:\n--------------\n`cat ${REPLOGRECV}`\n\n" 
    289294 
    290295  if [ $zStatus -eq 0 ] ; then 
     
    302307     echo "Failed with command:\n$zSEND | $zRCV\n" > ${FLOG} 
    303308     echo "\nSending log:\n" >> ${FLOG} 
    304      cat ${CMDLOG} >> ${FLOG} 
     309     cat ${REPLOGSEND} >> ${FLOG} 
    305310     echo "\nRecv log:\n" >> ${FLOG} 
    306      cat ${CMDLOG2} >> ${FLOG} 
     311     cat ${REPLOGRECV} >> ${FLOG} 
    307312     echo_log "FAILED replication task on ${DATASET}: LOGFILE: $FLOG" 
    308313  fi 
Note: See TracChangeset for help on using the changeset viewer.