Changeset 216


Ignore:
Timestamp:
Nov 6, 2010, 4:38:30 PM (14 years ago)
Author:
Rick van der Zwet
Message:

Por mans configuration backup

Location:
tools
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • tools/etcbackup.sh

    • Property svn:keywords set to Id
    r215 r216  
    11#!/bin/sh
    22#
    3 # $Id: mysqlbackup.sh 8548 2010-10-04 19:41:22Z rick $
    4 # Poor mans virtual mailbox backup.
     3# $Id$
     4# Poor mans configuration backup. Only save the new backup if configuration
     5# content changes
     6#
    57# Rick van der Zwet <info@rickvanderzwet.nl>
    68
     9TAG=`date "+%Y%m%d"`
    710
    8 TARGET=/usr/local/backup/vmailbackup/virtual.tar.gz
    9 tar -C /var/mail -czf $TARGET virtual
     11BACKUPROOT=/usr/local/backup/config
     12TARGET=$BACKUPROOT/etc-$TAG.tar
    1013
     14# Check for last backup file
     15mkdir -p $BACKUPROOT
     16LAST=`ls -t1 /usr/local/backup/config/etc-*.tar | head -1`
     17
     18if [ "$LAST" = "$TARGET" ]; then
     19  echo "# Error file '$TARGET' does already exists" 1>&2
     20  exit 1
     21fi
     22
     23# Create new backup file
     24tar -C / -cf $TARGET etc usr/local/etc 2>&1
     25
     26# If old file this exists, only keep new files if changes exists
     27if [ -n "$LAST" ]; then
     28  PREV_MD5=`md5 -q $LAST`
     29  NEW_MD5=`md5 -q $TARGET`
     30  if [ "$PREV_MD5" = "$NEW_MD5" ]; then
     31    rm $TARGET
     32  fi
     33fi
  • tools/mysqlbackup.sh

    • Property svn:keywords set to Id
    r215 r216  
    11#!/bin/sh
    22#
    3 # $Id: mysqlbackup.sh 8548 2010-10-04 19:41:22Z rick $
     3# $Id$
    44# Poor mans mysql database backup.
    55# Rick van der Zwet <info@rickvanderzwet.nl>
  • tools/vmailbackup.sh

    • Property svn:keywords set to Id
    r215 r216  
    11#!/bin/sh
    22#
    3 # $Id: mysqlbackup.sh 8548 2010-10-04 19:41:22Z rick $
     3# $Id$
    44# Poor mans virtual mailbox backup.
    55# Rick van der Zwet <info@rickvanderzwet.nl>
Note: See TracChangeset for help on using the changeset viewer.