CPUG: The Check Point User Group

Resources for the Check Point Community, by the Check Point Community.


I'd like to thank everyone involved for making "The CPUG Challenge" a great success.
We helped a lot of people see and learn a bit more about R80.10, while having some fun.
We will be using this success to try and bring more events to more locations soon. -E

 

Results 1 to 4 of 4

Thread: R80.10 Scheduled MDS Backup

  1. #1
    Join Date
    2012-08-03
    Posts
    3
    Rep Power
    0

    Default R80.10 Scheduled MDS Backup

    Hi,

    Is there a sample script to schedule backups in MDS via cron job and send the backups to an ftp/sftp server?

  2. #2
    Join Date
    2016-10-19
    Posts
    17
    Rep Power
    0

    Default Re: R80.10 Scheduled MDS Backup

    How about using the system backup option in the GUI, it also gives you an option to store the backup copy either on the appliance or ftp/scp to another destination.

  3. #3
    Join Date
    2012-08-03
    Posts
    3
    Rep Power
    0

    Default Re: R80.10 Scheduled MDS Backup

    Yes, thank you.

  4. #4
    Join Date
    2006-09-26
    Posts
    3,025
    Rep Power
    15

    Default Re: R80.10 Scheduled MDS Backup

    Quote Originally Posted by hbiris View Post
    Yes, thank you.
    there is a MUCH better way to do this. this mds_backup was written for R77.30 but it will work with R80.10 as well. Set a cron to run this script. Much better than Checkpoint built-in backup, IMHO.

    #!/bin/sh -x
    . /etc/profile.d/CP.sh

    DATE="`/bin/date +%b_%d_%Y_%Hh_%Mm`"
    FILENAME="mds_backup_`uname -n`_$DATE"
    LOG=/var/tmp/backup_log_$DATE
    BACKUPDIR=/var/backup/tmp
    LOCALSTORAGE=/var/backup/storage


    ### First, do no harm by entering the /var/tmp directory
    cd /var/tmp

    ### Set the mds environment with the mdsenv command

    mdsenv

    ### create /var/backup/tmp if one does not exist


    if ! [ -d /var/backup ]
    then
    echo "Backup folder missing, creating" >> $LOG
    mkdir /var/backup
    fi
    if ! [ -d /var/backup/tmp ]
    then
    echo "Backup tmp folder missing, creating" >> $LOG
    mkdir /var/backup/tmp
    fi
    if ! [ -d /var/backup/storage ]
    then
    echo "Backup storage folder missing, creating" >> $LOG
    mkdir /var/backup/storage
    fi
    if ! [ -d /var/backup/log ]
    then
    echo "Backup log folder missing, creating" >> $LOG
    mkdir /var/backup/log
    fi


    ### Enter $BACKUPDIR directory
    cd $BACKUPDIR

    ### Remove EVERYTHING inside $BACKUPDIR directory
    echo -e "Cleaning /var/backup/tmp" >> $LOG
    rm -rf /var/backup/tmp/*

    ### Create today mds_backups with today time directory
    echo -e "Creating $BACKUPDIR/$FILENAME directory\n" >> $LOG
    mkdir $BACKUPDIR/$FILENAME

    ### Enter $BACKUPDIR/$FILENAME

    cd $BACKUPDIR/$FILENAME

    ### Gather important system information

    /bin/clish -c 'show configuration' >> $BACKUPDIR/$FILENAME/configuration.txt

    # STOP MDS
    echo -e "==========\nStopping MDS\n==========\n" >> $LOG
    $MDSDIR/scripts/mdsstat >> $LOG
    $MDSDIR/scripts/mdsstop >> $LOG
    sleep 5

    # Pass 2
    $MDSDIR/scripts/mdsstat >> $LOG
    $MDSDIR/scripts/mdsstop >> $LOG
    sleep 5

    ## Perform backup
    echo -e "\n==================\nBeginning mdsbackup\n==================\n" >> $LOG
    #echo y | $MDSDIR/scripts/mds_backup -b -d $BACKUPDIR/$FILENAME 2>> $LOG >> /dev/null
    echo y | $MDSDIR/scripts/mds_backup -s -L all -b -d $BACKUPDIR/$FILENAME 2>> $LOG >> /dev/null
    echo -e "\n==================\nCompleted mdsbackup\n==================\n" >> $LOG

    ### Pack up
    echo -e "Packing up Backup Folder" >> $LOG
    md5sum $BACKUPDIR/$FILENAME/* > $BACKUPDIR/$FILENAME/md5sum.txt
    tar -cvf $BACKUPDIR/$FILENAME.tar $BACKUPDIR/$FILENAME
    mv $BACKUPDIR/$FILENAME.tar $LOCALSTORAGE/

    echo -e "\nStarting MDS\n" >> $LOG
    $MDSDIR/scripts/mdsstart >> $LOG
    sleep 60
    $MDSDIR/scripts/mdsstat >> $LOG

    ## Transfer backup file to an external sFTP server using key-authentication
    echo -e "Off-loading backup files to network" >> $LOG
    scp -i /etc/scripts/.ssh/id_rsa $LOCALSTORAGE/$FILENAME.tar root@192.168.1.1:/data/backup >> $LOG

    ## Move log file into /var/backup directory for archiving
    mv $LOG /var/backup/log

Similar Threads

  1. Scheduled Backup Not Working
    By venkata in forum R80
    Replies: 2
    Last Post: 2016-10-24, 14:14
  2. Replies: 1
    Last Post: 2012-11-20, 20:30
  3. Scheduled local backup failed one day
    By Kriss in forum Check Point Backup Procedures
    Replies: 0
    Last Post: 2011-10-25, 07:47
  4. Voyager Scheduled backup and Automatic FTP
    By JamesW in forum Check Point Backup Procedures
    Replies: 3
    Last Post: 2007-04-23, 11:21
  5. problem with scheduled backup in NG secure platform
    By peteralm in forum Check Point SecurePlatform (SPLAT)
    Replies: 3
    Last Post: 2005-11-22, 15:36

Bookmarks

Posting Permissions

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