Results 1 to 9 of 9

Thread: ubuntu server backup

Threaded View

  1. #8
    Shrekkie Reloaded Raiden's Avatar
    Join Date
    Oct 2005
    Posts
    1,115
    You could easily use "tar -cf <name-of-tar> <things-to-backup> to gather all thath needs to be backed up.

    From the other hand you could rsync to a disk or another server. For example, I have a script to backup to my USB-drive. The script is not entirely finished but it works.
    It only adds/deletes/updates files depending on what has happened with a file.

    For the reference, if you can do anything with it (I'm not a good scripter ):

    #!/bin/bash
    DRIVE_SERIAL="<serialnumber-of-the-usb-drive"
    DETECTION=`cat /proc/bus/usb/devices | grep SerialNumber=$DRIVE_SERIAL`
    LOGFILE=/var/scripts/backup.log
    RSYNC_TIMESTAMP=`date "+&#37;d%m%y"`
    RSYNC_LOGFILE="/var/scripts/rsync_$RSYNC_TIMESTAMP.log"
    BUSYFILE=/var/scripts/backup.busy

    if [ "$DETECTION" == "" ]; then
    echo "`date "+%b %d %H:%m:%S"` - USB-drive not attached. Exit." >> $LOGFILE
    else
    echo "`date "+%b %d %H:%m:%S"` - USB-drive found !" >> $LOGFILE
    echo "`date "+%b %d %H:%m:%S"` - Checking for running jobs ..." >> $LOGFILE
    if [ -f "$BUSYFILE" ]; then
    echo "`date "+%b %d %H:%m:%S"` - Busy-file found !" >> $LOGFILE
    echo "`date "+%b %d %H:%m:%S"` - Another backup already in progress. Exit." >> $LOGFILE
    exit
    else
    echo "`date "+%b %d %H:%m:%S"` - Busy-file not found. Good. Proceeding to backup." >> $LOGFILE
    echo "1" >> $BUSYFILE

    echo "`date "+%b %d %H:%m:%S"` - Mounting USB-drive ..." >> $LOGFILE
    mount -t ntfs-3g /dev/sdc1 /mnt/backup

    echo "`date "+%b %d %H:%m:%S"` - RSYNC Started." >> $LOGFILE
    rsync -vrlptg --log-file=$RSYNC_LOGFILE /xen/ /mnt/backup/Backup/xen
    rsync -vrlptg --log-file=$RSYNC_LOGFILE /raid3/ /mnt/backup/Backup/data
    echo "`date "+%b %d %H:%m:%S"` - RSYNC Finished." >> $LOGFILE

    echo "`date "+%b %d %H:%m:%S"` - Unmounting drives ..." >> $LOGFILE
    umount /dev/sdc1

    echo "`date "+%b %d %H:%m:%S"` - Releasing BACKUP_BUSY variable ..." >> $LOGFILE
    rm $BUSYFILE
    fi
    fi
    Last edited by Raiden; June 11th, 2009 at 03:39 PM.

Similar Threads

  1. Windows Error Messages
    By cheyenne1212 in forum Miscellaneous Security Discussions
    Replies: 7
    Last Post: February 1st, 2012, 02:51 PM
  2. Replies: 0
    Last Post: August 3rd, 2004, 05:32 PM
  3. Heads Up - Cumulative Patch for Microsoft SQL Server (815495)
    By CXGJarrod in forum Microsoft Security Discussions
    Replies: 0
    Last Post: July 23rd, 2003, 10:00 PM
  4. Newbies, list of many words definitions.
    By -DaRK-RaiDeR- in forum Newbie Security Questions
    Replies: 9
    Last Post: December 14th, 2002, 08:38 PM

Tags for this Thread

Posting Permissions

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