User Tools

Site Tools


linuxtips:secureremotebackup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linuxtips:secureremotebackup [2012/01/14 03:51]
0.0.0.0 created
linuxtips:secureremotebackup [2012/01/14 05:03] (current)
mschiff Page moved from secureremotebackup to linuxtips:secureremotebackup
Line 36: Line 36:
      fi</code>      fi</code>
  
--    if [[|-d "$BACKUPDEV" ]]; then +-    if [[secureremotebackup|-d "$BACKUPDEV" ]]; then 
-+    if $RSH_CMD [[|-d "$BACKUPDEV" ]]; then++    if $RSH_CMD [[secureremotebackup|-d "$BACKUPDEV" ]]; then
 <code> <code>
         BACKUPDIR=$BACKUPDEV;         BACKUPDIR=$BACKUPDEV;
Line 46: Line 46:
  {  {
      VOLUMENAME=$2                   # store name for usage in .rc file</code>      VOLUMENAME=$2                   # store name for usage in .rc file</code>
--    if [[|-d "$BACKUPDIR" ]]; then+-    if [[secureremotebackup|-d "$BACKUPDIR" ]]; then
 -       BACKUPDEV=`$LS ${BACKUPDIR}/${VOLUMENAME}_*full.gz` -       BACKUPDEV=`$LS ${BACKUPDIR}/${VOLUMENAME}_*full.gz`
-+    if $RSH_CMD [[|-d "$BACKUPDIR" ]]; then++    if $RSH_CMD [[secureremotebackup|-d "$BACKUPDIR" ]]; then
 +       BACKUPDEV=`$RSH_CMD $LS ${BACKUPDIR}/${VOLUMENAME}_*full.gz` +       BACKUPDEV=`$RSH_CMD $LS ${BACKUPDIR}/${VOLUMENAME}_*full.gz`
 <code> <code>
Line 59: Line 59:
      gzip -c $TMPLIST > $TOBLISTS/$2.Full.gz</code>      gzip -c $TMPLIST > $TOBLISTS/$2.Full.gz</code>
  
--    if [[|-d "$BACKUPDIR" ]]; then +-    if [[secureremotebackup|-d "$BACKUPDIR" ]]; then 
-+    if $RSH_CMD [[|-d "$BACKUPDIR" ]]; then++    if $RSH_CMD [[secureremotebackup|-d "$BACKUPDIR" ]]; then
 <code> <code>
         UPTO=`basename $BACKUPDEV`         UPTO=`basename $BACKUPDEV`
Line 67: Line 67:
 -       cd $BACKUPDIR -       cd $BACKUPDIR
 -       for i in `find ${VOLUMENAME}_* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do -       for i in `find ${VOLUMENAME}_* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do
--               if [[|$i == $UPTO ]]; then+-               if [[secureremotebackup|$i == $UPTO ]]; then
 -                       SEEN=1 -                       SEEN=1
 -               fi -               fi
--               if [[|$SEEN == '0' ]]; then+-               if [[secureremotebackup|$SEEN == '0' ]]; then
 -                       message "Deleted old backup $i" -                       message "Deleted old backup $i"
 -                       $RM -f $i -                       $RM -f $i
 -               fi -               fi
 -       done -       done
-+       if [[|"$RSH_CMD" ]]; then++       if [[secureremotebackup|"$RSH_CMD" ]]; then
 +               for i in `$RSH_CMD "cd $BACKUPDIR; find ${VOLUMENAME}_* -mtime +$MAXBACKUPAGE -exec echo {} \;"`; do +               for i in `$RSH_CMD "cd $BACKUPDIR; find ${VOLUMENAME}_* -mtime +$MAXBACKUPAGE -exec echo {} \;"`; do
-+                       if [[|$i == $UPTO ]]; then++                       if [[secureremotebackup|$i == $UPTO ]]; then
 +                               SEEN=1 +                               SEEN=1
 +                       fi +                       fi
-+                       if [[|$SEEN == '0' ]]; then++                       if [[secureremotebackup|$SEEN == '0' ]]; then
 +                               message "Deleted old backup $i" +                               message "Deleted old backup $i"
 +                               $RSH_CMD "cd $BACKUPDIR; $RM -f $i" +                               $RSH_CMD "cd $BACKUPDIR; $RM -f $i"
Line 88: Line 88:
 +               cd $BACKUPDIR +               cd $BACKUPDIR
 +               for i in `find ${VOLUMENAME}_* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do +               for i in `find ${VOLUMENAME}_* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do
-+                       if [[|$i == $UPTO ]]; then++                       if [[secureremotebackup|$i == $UPTO ]]; then
 +                               SEEN=1 +                               SEEN=1
 +                       fi +                       fi
-+                       if [[|$SEEN == '0' ]]; then++                       if [[secureremotebackup|$SEEN == '0' ]]; then
 +                               message "Deleted old backup $i" +                               message "Deleted old backup $i"
 +                               $RM -f $i +                               $RM -f $i
Line 106: Line 106:
      gzip -c "$TMPLIST1" > "$TOBLISTS/$2.differential.gz"</code>      gzip -c "$TMPLIST1" > "$TOBLISTS/$2.differential.gz"</code>
  
--    if [[|-d "$BACKUPDIR" ]]; then +-    if [[secureremotebackup|-d "$BACKUPDIR" ]]; then 
-+    if $RSH_CMD [[|-d "$BACKUPDIR" ]]; then++    if $RSH_CMD [[secureremotebackup|-d "$BACKUPDIR" ]]; then
 <code> <code>
         UPTO=`basename $BACKUPDEV`         UPTO=`basename $BACKUPDEV`
Line 115: Line 115:
 -       $RM -f ${VOLUMENAME}_*inc* -       $RM -f ${VOLUMENAME}_*inc*
 -       for i in `find ${VOLUMENAME}_*diff* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do -       for i in `find ${VOLUMENAME}_*diff* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do
--               if [[|$i == $UPTO ]]; then+-               if [[secureremotebackup|$i == $UPTO ]]; then
 -                       SEEN=1 -                       SEEN=1
 -               fi -               fi
--               if [[|$SEEN == '0' ]]; then+-               if [[secureremotebackup|$SEEN == '0' ]]; then
 -                       message "Deleting old backup $i" -                       message "Deleting old backup $i"
 -                       $RM -f $i -                       $RM -f $i
 -               fi -               fi
 -       done -       done
-+       if [[|"$RSH_CMD" ]]; then++       if [[secureremotebackup|"$RSH_CMD" ]]; then
 +               $RSH_CMD "cd $BACKUPDIR; $RM -f ${VOLUMENAME}_*inc*" +               $RSH_CMD "cd $BACKUPDIR; $RM -f ${VOLUMENAME}_*inc*"
 +               for i in `$RSH_CMD "cd $BACKUPDIR; find ${VOLUMENAME}_*diff* -mtime +$MAXBACKUPAGE -exec echo {} \;"`; do +               for i in `$RSH_CMD "cd $BACKUPDIR; find ${VOLUMENAME}_*diff* -mtime +$MAXBACKUPAGE -exec echo {} \;"`; do
-+                       if [[|$i == $UPTO ]]; then++                       if [[secureremotebackup|$i == $UPTO ]]; then
 +                               SEEN=1 +                               SEEN=1
 +                       fi +                       fi
-+                       if [[|$SEEN == '0' ]]; then++                       if [[secureremotebackup|$SEEN == '0' ]]; then
 +                               message "Deleting old backup $i" +                               message "Deleting old backup $i"
 +                               $RSH_CMD "cd $BACKUPDIR; $RM -f $i" +                               $RSH_CMD "cd $BACKUPDIR; $RM -f $i"
Line 138: Line 138:
 +               $RM -f ${VOLUMENAME}_*inc* +               $RM -f ${VOLUMENAME}_*inc*
 +               for i in `find ${VOLUMENAME}_*diff* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do +               for i in `find ${VOLUMENAME}_*diff* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do
-+                       if [[|$i == $UPTO ]]; then++                       if [[secureremotebackup|$i == $UPTO ]]; then
 +                               SEEN=1 +                               SEEN=1
 +                       fi +                       fi
-+                       if [[|$SEEN == '0' ]]; then++                       if [[secureremotebackup|$SEEN == '0' ]]; then
 +                               message "Deleting old backup $i" +                               message "Deleting old backup $i"
 +                               $RM -f $i +                               $RM -f $i
Line 156: Line 156:
  {</code>  {</code>
  
--    if [[|-d "$BACKUPDIR" ]]; then +-    if [[secureremotebackup|-d "$BACKUPDIR" ]]; then 
-+    if $RSH_CMD [[|-d "$BACKUPDIR" ]]; then++    if $RSH_CMD [[secureremotebackup|-d "$BACKUPDIR" ]]; then
 <code> <code>
        message "Generating report of $BACKUPDIR."</code>        message "Generating report of $BACKUPDIR."</code>
Line 171: Line 171:
      message "Restoring volume $VOLUMENAME files matching $FILESPEC into $startdir."</code>      message "Restoring volume $VOLUMENAME files matching $FILESPEC into $startdir."</code>
  
--    if [[|-d "$BACKUPDIR" ]]; then+-    if [[secureremotebackup|-d "$BACKUPDIR" ]]; then
 -       for i in `$LS ${BACKUPDIR}/${VOLUMENAME}_*gz`; do -       for i in `$LS ${BACKUPDIR}/${VOLUMENAME}_*gz`; do
-+    if $RSH_CMD [[|-d "$BACKUPDIR" ]]; then++    if $RSH_CMD [[secureremotebackup|-d "$BACKUPDIR" ]]; then
 +       for i in `$RSH_CMD $LS ${BACKUPDIR}/${VOLUMENAME}_*gz`; do +       for i in `$RSH_CMD $LS ${BACKUPDIR}/${VOLUMENAME}_*gz`; do
 <code> <code>
Line 233: Line 233:
 This generates a password from 1024 random bytes and writes it into the file <i>/etc/tob/aespipe.pwd</i> This generates a password from 1024 random bytes and writes it into the file <i>/etc/tob/aespipe.pwd</i>
  
---[[User:Mschiff|mschiff]] 13:26, 31 Mar 2005 (CEST)+--[[user:mschiff|mschiff]] 13:26, 31 Mar 2005 (CEST)
linuxtips/secureremotebackup.txt · Last modified: 2012/01/14 05:03 by mschiff