[bglug] Backafio v1.1
k|b|s
bglug@lists.linux.it
Sat, 12 Apr 2003 18:27:18 +0200
--Boundary-00=_n5Dm+Qffr6GlcH+
Content-Type: Text/Plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Description: clearsigned data
Content-Disposition: inline
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ho fatto uno script vergognoso per il backup che utilizza afio=20
(http://www.freshmeat.net/projects/afio), un programma per manipolare=20
gli archivi totalmente compatibile anche con cpio ecc.
Vi pregherei di provarlo e sapermi dire qualcosa; specialmente se non=20
funziona ;)
Scaricatevi afio (sono 89k) e provate.
Grazie.
ciao
TODO: appena ho tempo -> CD-RW, Samba
=2D --=20
I need a lifesystem check.
* k|b|s * mailto `echo ti.gulgb@sbk|'rev'`=20
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+mD5qPJE4D78UP9MRApR4AJoDVzXuIuxIwruH71+Ri9GmaxmXkQCcDjmX
uM8sqfqRnj80pWDhTMnSRwU=3D
=3DVrKO
=2D----END PGP SIGNATURE-----
--Boundary-00=_n5Dm+Qffr6GlcH+
Content-Type: application/x-shellscript;
name="backafio"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="backafio"
#!/bin/bash
#
# Backafio - v 1.1
#
# A simple shell script for backup using afio.
# Change variables to fit you needs. You can simply
# restore your data with the command:
# afio -i Backupfile
# for more options read the afio documentation.
# Have fun :^)
#
# LICENSE: GPL - http://www.gnu.org/licenses/gpl.txt
#
# Requirements: afio
# http://www.freshmeat.net/projects/afio
#
#################################################
# Your configuration - Modify to fit your needs
# Files to backup - Insert as much files/dirs as you want, separated=20
# with a space
# Example: "/bin /boot /etc /home /lib /opt /root /sbin /usr /var"
=46ILES=3D"/home/kbs/scripts /home/kbs/News"
# Insert the path where you want to save your backup
# The directory should exist!=20
# Default is your working directory.
OUTDIR=3D""
# Say 1 if you want to compress your backup. Then choose the=20
# compressrate you prefer. A medium value is 6.
COMPRESS=3D1
COMPRESSRATE=3D9
# Do you want to burn your backup? Set 1 and define the speed of
# recording, the device (make a "cdrecord --scanbus" to scan your SCSI
# devices), and if you want eject after burning.
CDRECORD=3D0
SPEED=3D4
DEVICE=3D"1,0,0"
EJECT=3D0
# I think you would have a complete log of all operations
VERBOSE=3D1
# Say 1 if you want to be emailed when finished
# Insert your email address
EMAIL=3D1
EMAILADDRESS=3Dkbs
# End of configuration
#################################################
#################################################
# Edit below this line only if you know what you
# are doing
OUTFILE=3D"Backup.`date +'%d-%m-%y'`"
OUTFILELOG=3D"Backup.`date +'%d-%m-%y'`.log"
EMAILSUBJECT=3D"Backup of $HOSTNAME finished!"
TMP=3D"/tmp/backup"
LOGFILE=3D$TMP/Backup.`date +'%d-%m-%y'`.log
ISO=3D$TMP/Backup.iso
PROGRAM=3D"Backafio"
VERSION=3D"1.1"
LICENSE=3D"GPL - http://www.gnu.org/licenses/gpl.txt"
# Variabili
if test $VERBOSE -eq 1
then VERBOSECOMMAND=3D"-v"
fi
#
if test $COMPRESS -eq 1
then COMPRESSCOMMAND=3D"-Z"
fi
#
if [ ! -d $TMP ]; then=20
mkdir -p $TMP=20
chmod 700 $TMP
fi
#
if test $EJECT -eq 1
then $EJECTCOMMAND=3D"-eject"
fi
# Log
exec 3>&1
exec 1>$LOGFILE
exec 2>&1
# Do Backup
echo " "
echo "##################################################"
echo " "
echo "$PROGRAM v $VERSION by * k|b|s * mailto `echo ti.gulgb@sbk|'rev'`"
echo "License: $LICENSE"
echo " "
echo "Running backup of `echo $FILES` on $HOSTNAME"
echo "Starting time: `date`"
echo " "
echo " "
echo " "
# Backup vero e proprio
find $FILES -depth | afio -o $VERBOSECOMMAND -G $COMPRESSRATE $COMPRESSCOMM=
AND $OUTDIR$OUTFILE
cat $LOGFILE > $OUTDIR$OUTFILELOG
echo " "
# Cdrecord
if test $CDRECORD -eq 1
then mkisofs -J -R -o $ISO $OUTDIR$OUTFILE && cdrecord $EJECTCOMMAND spee=
d=3D$SPEED dev=3D$DEVICE $ISO
fi
=20
echo " "
echo " "
echo "Total filesize: `du -h $OUTDIR$OUTFILE`"
echo " "
echo "Finishing Time: `date`"
echo " "
echo "###################################################"
# Email
if [ $EMAIL -eq 1 ]
then cat $LOGFILE | mail -s "$EMAILSUBJECT" $EMAILADDRESS
fi
=20
#
rm -rf $TMP
# Anche questa =E8 fatta.
--Boundary-00=_n5Dm+Qffr6GlcH+--