Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jan 2005 14:59:40 +0100
From:      The FAQchest <genefaq@abac.com>
To:        Mike Jeays <Mike.Jeays@rogers.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: mkisofs and growisofs
Message-ID:  <B50AFB62-6246-11D9-A23B-000393932C94@abac.com>
In-Reply-To: <1105278401.624.21.camel@chaucer>
References:  <1105278401.624.21.camel@chaucer>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail-1-270445735
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

"Make ISO file system"

Generates a file matching with ISO9660 specification and with various 
extensions, such as rock-ridge extensions to go beyond 9660 limitations 
(file names and folder nesting). I use mkisofs to create backups.

Such files can be mounted using the "loop device".

See this script.

Rgds,
Thierry


On Jan 9, 2005, at 2:46 PM, Mike Jeays wrote:

> Where are they?  They don't seem to exist on my 5.3 system, and I can't
> find any trace of them in /usr/ports.  pkg_add -r doesn't find them
> either.
>


--Apple-Mail-1-270445735
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0755;
	name="create_an_ISO_backup-IMAP.sh"
Content-Disposition: attachment;
	filename=create_an_ISO_backup-IMAP.sh

#!/bin/bash
#
# Backup utility created by Thierry de Villeneuve to
# generate an ISO9660 image to be burned on a CD-ROM
#
# Not Copyrighted material
# 
# This software is provided "as is" without warranty of any kind, whether
# express or implied, including but not limited to any implied warranty of
# satisfactory quality or fitness for a particular purpose, or of non-
# infringement of any third party's proprietary rights. 
#
#
########################### TVN standard CVS header #########################
#
# $Id: create_an_ISO_backup-IMAP.sh,v 1.2 2002/06/07 21:51:27 thierry Exp $
#
# $Revision: 1.2 $
#
# $Source: /extra/cvs/thierrys/Shell/create_an_ISO_backup-IMAP.sh,v $
#
# $Log: create_an_ISO_backup-IMAP.sh,v $
# Revision 1.2  2002/06/07 21:51:27  thierry
# Tracked in CVS
#
#
#############################################################################
# 
#
# Created TVN, 24-Sep-99
# Upated TVN, 20-Mar-01
#
# mkisofs version 1.13 minimum is required for this script.
#

GOODUSER=root
MENAME=`basename $0`
export DATESTMP=`date '+%Y%m%d'`
export HOSTLONG=`hostname`
export OSNAME=`uname -s`
export MENAME=${MENAME%%.*}
export HOSTSHRT=${HOSTLONG%%.*}
export LOCKFILE=/var/tmp/$MENAME.lock
export LOGFILE=/tmp/$MENAME.log
export IMAGFILE=${1:-/extra/isoimages/$OSNAME"-"$HOSTSHRT"-IMAP-"$DATESTMP.iso}
export TOID=rbc.automation@st.com
export FROMID=rbc.automation@st.com
export RELAY1=usx011.crn.st.com
export RELAY2=rbmail.rbc.st.com

whoiam=$(whoami)
if [ $whoiam != $GOODUSER ]; then
  echo Needs to be run only by the user $GOODUSER
  exit 1
fi

basedir=${IMAGFILE%/*}
if [ ! -d $basedir ]; then
  echo "Error: Non existent $basedir. Quitting"
  exit 1
fi

if [ -f $LOCKFILE ]; then
    echo "Error: Lock file found."
    echo " $MENAME is already running."
    echo " if you believe it's not true: delete $LOCKFILE"
    exit 1
  fi

if ( tty -s ); then
    echo "Job is detaching and running in background."
  fi

# Detaching to background
(

  trap "cd /tmp; rm -f $LOCKFILE 1>&- 2>&-; exit" 0 1 2 3 15
  umask 022
  touch $LOCKFILE 1>&- 2>&-

  memdir=$(pwd)
  cd /
  # On this machine is loaded mkisofs v 1.13
  date "+===start=== Creating `basename $IMAGFILE` on today %c" > $LOGFILE 2>&1
  logger -t "$MENAME[$$]" "Creating ISOimage $IMAGFILE" >/dev/null 2>&1
  rm -f $IMAGFILE 2>&- 1>&1
  mkisofs -A "Backup system of $HOSTSHRT: $DATESTMP" \
    -l -L -J -R -graft-points -hide-rr-moved -hide-joliet-trans-tbl \
    -o $IMAGFILE -m core -m lost+found \
    -x /var/spool/mail/thierryv -x /extra/imap/thierryv \
    $HOSTSHRT/etc/=/etc \
    $HOSTSHRT/var/spool/mail/=/var/spool/mail \
    $HOSTSHRT/extra/imap/=/extra/imap >> $LOGFILE 2>&1

  if [ ! -s $IMAGFILE ]; then
    date '+===done=== %c' >> $LOGFILE 2>&1
    logger -t "$MENAME[$$]" "Failed creating ISOimage $IMAGFILE" >/dev/null 2>&1
    cat $LOGFILE | /usr/local/bin/putmail.pl \
      -s "Error generating backup ISO image on $HOSTSHRT for $DATESTMP" \
      -t $TOID -f $FROMID -r $RELAY1 -r $RELAY2 >/dev/null 2>&1
  else
    ls -al $IMAGFILE >> $LOGFILE 2>&1
    chown nobody:nobody $IMAGFILE >/dev/null 2>&1
    date '+===done=== %c' >> $LOGFILE 2>&1
    logger -t "$MENAME[$$]" "done" >/dev/null 2>&1
  fi
  cd $memdir
  exit 0

) &
exit 0


--Apple-Mail-1-270445735--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B50AFB62-6246-11D9-A23B-000393932C94>