Changeset f615958


Ignore:
Timestamp:
08/06/13 12:09:08 (15 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:
959fb5c
Parents:
a4ac142
Message:

Update cron functionality for snapshots, allow us to specify a specific hour to
run at when doing daily snapshots

Location:
src-sh/lpreserver
Files:
4 edited

Legend:

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

    rfeb0fb0 rf615958  
    105105 
    106106   case $2 in 
    107        daily) cLine="0      01       *       *       *" ;; 
     107       daily) cLine="0       $4      *       *       *" ;; 
    108108      hourly) cLine="0       *       *       *       *" ;; 
    109109       30min) cLine="0,30    *       *       *       *" ;; 
  • src-sh/lpreserver/backend/zfscronsnap.sh

    r1fd551d rf615958  
    2222 
    2323  TIME="${3}" 
     24 
     25  # See if the user is running daily with a hour specified 
     26  echo $TIME | grep -q "daily" 
     27  if [ $? -eq 0 ] ; then 
     28     hour="`echo $TIME | cut -d '@' -f 2`" 
     29     if [ -z "$hour" ] ; then hour="22" ; fi 
     30     TIME="daily" 
     31  fi 
     32 
    2433  COUNT="${4}" 
    2534  case $TIME in 
     
    3140  fi 
    3241 
    33   enable_cron "$DATASET" "$TIME" "$COUNT" 
    34   echo "Snapshot frequency set: $TIME" 
     42  enable_cron "$DATASET" "$TIME" "$COUNT" "$hour" 
     43  echo "Snapshot frequency set: $TIME @ $hour" 
    3544  echo "Snapshot # to keep set: $COUNT" 
    3645  exit 0 
  • src-sh/lpreserver/backend/zfslistcron.sh

    r1fd551d rf615958  
    1919   hour=`grep "${PROGDIR}/backend/runsnap.sh" /etc/crontab | awk '{print $2}'` 
    2020   time="Min: $min Hour: $hour"; 
    21    if [ "$min" = "0" -a "$hour" = "01" ] ; then time="daily" ; fi 
     21   if [ "$min" = "0" -a "$hour" != '*' ] ; then time="daily@$hour" ; fi 
    2222   if [ "$min" = "0" -a "$hour" = '*' ] ; then time="hourly" ; fi 
    2323   if [ "$min" = "0,30" ] ; then time="30min" ; fi 
  • src-sh/lpreserver/lpreserver

    rfeb0fb0 rf615958  
    208208   
    209209  action = start / stop 
    210   frequency = daily / hourly / 30min / 10min / 5min 
     210  frequency = daily@XX / hourly / 30min / 10min / 5min 
     211                    ^^ Hour to execute 
    211212  numToKeep = Number of snapshots to keep total 
    212213 
    213214Example: 
    214215 
    215   lpreserver cronsnap tank1/usr/home/kris start daily 10 
     216  lpreserver cronsnap tank1/usr/home/kris start daily@22 10 
    216217 
    217218  or 
Note: See TracChangeset for help on using the changeset viewer.