Results 1 to 2 of 2

Thread: Backup script for et9000

  1. #1
    Super Moderator aguda's Avatar
    Join Date
    09-12-2007
    Posts
    10,343
    Uploads
    2,875

    Backup script for et9000

    Backup script for et9000

    Code:
    TARGET="XX"
    
    build-usb-image.sh /media/hdd | tee /tmp/NFI-Backup.log
    wait 3
    if [ -f "/media/usb/etbackupstick" -o -f "/media/usb/etbackupstick.txt" ]
    then
        TARGET="/media/usb"
    elif [ -f "/media/sdb1/etbackupstick" -o -f "/media/sdb1/etbackupstick.txt" ]
    then
        TARGET = "/media/sdb1"
    elif [ -f "/media/sdc1/etbackupstick" -o -f "/media/sdc1/etbackupstick.txt" ]
    then
        TARGET = "/media/sdc1"
    elif [ -f "/media/sdd1/etbackupstick" -o -f "/media/sdd1/etbackupstick.txt" ]
    then
        TARGET = "/media/sdd1"
    fi
    if [ $TARGET = "XX" ]
    then
        echo
    else
        echo please wait...
        cp -r /media/hdd/et9000/ $TARGET
        sleep 3
        umount $TARGET
        sleep 5
    	echo Backup finished and copied to your USB-stick
        echo 
        echo       REMOVE YOUR USB STICK NOW !!!
    fi
    Attached Files Attached Files

  2. #2
    Super Moderator aguda's Avatar
    Join Date
    09-12-2007
    Posts
    10,343
    Uploads
    2,875

    Re: Backup script for et9000

    ################################################## ###########
    # USB BACKUP Utility for ENIGMA2
    # Version 1.0 - 03-12.2010
    # supports USB Backups

    ################################################## ###########
    [/B]

    Code:
    #
    #############################################################
    # USB BACKUP Utility for ENIGMA2
    # Version 1.0 - 03-12.2010
    # supports USB Backups
    
    #############################################################
    #
    #!/bin/sh
    
    VERSION="Version 1.0 - 03.12.2010"
    DIRECTORY=$1
    
    if grep et9000 /etc/hostname > /dev/null ; then
        MODEL=et9000
        OPTIONS="--eraseblock=0x20000 -n -l"
    else
        echo "No right MODEL Box detected !!!"
        exit 0
    fi
    
    echo "________________________________________________________"
    echo " "
    echo  "USB Backup Tool for $MODEL " $VERSION
    echo "________________________________________________________"
    echo " "
    echo "Please be patience, a backup will now be made,"
    echo "this will take approximately 2 minutes "
    echo "________________________________________________________"
    
    DATE=`date +%Y%m%d_%H%M%S`
    IMAGEVERSION=`date +%Y%m%d`
    MKFS=/usr/bin/mkfs.jffs2
    BUILDIMAGE=/usr/bin/buildimage
    NANDDUMP=/usr/bin/nanddump
    EXTRA=$DIRECTORY/fullbackup_$MODEL/$DATE
    
    if [ ! -f $MKFS ] ; then
    	echo $MKFS" not found"
    	exit 0
    fi
    
    if [ ! -f $BUILDIMAGE ] ; then
    	echo $BUILDIMAGE" not found"
    	exit 0
    fi
    
    if [ ! -f $NANDDUMP ] ; then
    	echo $NANDDUMP" not found"
    	exit 0
    fi
    
    rm -rf $DIRECTORY/bi
    mkdir -p $DIRECTORY/bi
    mkdir -p /tmp/bi/boot
    mkdir -p /tmp/bi/root
    
    
    if [ $MODEL = "et9000" ] ; then
    mount -t jffs2 /dev/mtdblock2 /tmp/bi/boot
    mount -t jffs2 /dev/mtdblock3 /tmp/bi/root
     
    fi
    
    if [ -s $BUILDIMAGE ] ; then
    	echo "Create boot.jffs2"
    	$MKFS --root=/tmp/bi/boot --faketime --output=$DIRECTORY/bi/boot.jffs2 $OPTIONS
    	echo "Create root.jffs2"
    	$MKFS --root=/tmp/bi/root --faketime --output=$DIRECTORY/bi/root.jffs2 $OPTIONS
    fi
    
    echo "Create kerneldump"
    
    if [ $MODEL = "et9000" ] ; then
    	nanddump /dev/mtd1 -o -b > $DIRECTORY/bi/vmlinux.gz
    fi
    
    echo "________________________________________________________"
    echo " "
    echo "Creating $MODEL USB-Backup Image"
    echo "________________________________________________________"
    
        mkdir -p $DIRECTORY/$MODEL
        mkdir -p $EXTRA
        mv $DIRECTORY/bi/root.jffs2 $DIRECTORY/$MODEL/rootfs.bin
        mv $DIRECTORY/bi/boot.jffs2 $DIRECTORY/$MODEL/boot.bin
        mv $DIRECTORY/bi/vmlinux.gz $DIRECTORY/$MODEL/kernel.bin
        echo "rename this file to 'force' to force an update without confirmation" > $DIRECTORY/$MODEL/noforce;
        echo $MODEL-$IMAGEVERSION > $DIRECTORY/$MODEL/imageversion;
        cp -r $DIRECTORY/$MODEL $EXTRA/$MODEL #copy the made back-up to images
    
    if [ -f $DIRECTORY/$MODEL/rootfs.bin -a -f $DIRECTORY/$MODEL/boot.bin -a -f $DIRECTORY/$MODEL/kernel.bin -a -f $DIRECTORY/$MODEL/imageversion -a -f $DIRECTORY/$MODEL/noforce ] ; then
        echo "________________________________________________________"
    	echo " "
    	echo "USB Image created on:" $DIRECTORY"/$MODEL "
    	echo "and there is made an extra copy on:" 
    	echo $EXTRA"/$MODEL"
    	echo "________________________________________________________"	
    
    	echo " "
    	echo "                To restore the image: "
    	echo "Place the USB-stick in the front USB-port and switch the "
    	echo "$MODEL off and on with the powerswitch on the back of "
    	echo "the $MODEL. Follow the instructions on front-display." 
    	echo " "
    else
    	echo "Image creation failed - "
    	echo "e.g. wrong backup destination or"
    	echo "no space left on backup device"
    fi
    
     umount /tmp/bi/root
     umount /tmp/bi/boot
     rm -rf /tmp/bi
     rm -rf $DIRECTORY/bi
    
    exit
    Attached Files Attached Files

Similar Threads

  1. New drivers et9000
    By aguda in forum Clarke-Tech / Xtrend Software and Tools
    Replies: 17
    Last Post: 08-05-2013, 23:00:19
  2. OSCam Easy Build Script (script only!)
    By sami.sami in forum OSCam Plugins
    Replies: 43
    Last Post: 25-04-2012, 19:34:36
  3. PLI files for ET9000
    By aguda in forum Clarke-Tech / Xtrend Software and Tools
    Replies: 0
    Last Post: 06-12-2010, 21:25:33
  4. Backup script for DM800 Ferrari SSL76
    By aguda in forum Dreambox DM 800 HD PVR Images
    Replies: 0
    Last Post: 31-05-2010, 22:30:22
  5. script for backup and restore
    By sami.sami in forum AZBox Software and Tools
    Replies: 0
    Last Post: 25-11-2009, 16:09:02

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •