Koozali.org: home of the SME Server

Backup to harddisk

WEBlance

Backup to harddisk
« on: February 14, 2005, 04:39:45 PM »
Hi!

Is it possible to backup to a harddisk instead of tape?

My machines configuration is like this:

Primary and secondary harddisks running RAID (SME controlled)
CD-ROM drive running as secondary slave.

Is it possible to install a harddisk as primary slave and make SME to backup on it every day/week/month etc. just as it was a tape?

If it is possible please tell me how to make it so!

Thanx!

/Carl

jcoleman

Backup to harddisk
« Reply #1 on: February 15, 2005, 12:11:44 AM »
The search tool is your friend.  :-)  

There is a LOT of info on this site concerning backups.  A search for "backup disk" produced quite a lot of hits...

You might want to look at:

http://no.longer.valid/phpwiki/index.php/Back%20Up

There are some otpions there that may be what you are looking for.

-jeff

WEBlance

Backup to harddisk
« Reply #2 on: February 15, 2005, 05:49:45 AM »
Quote
The search tool is your friend.  

There is a LOT of info on this site concerning backups. A search for "backup disk" produced quite a lot of hits...

I know this!!! I already tried to search this site for what I'm looking for!

Thanks for your answer, but it only describes how to backup to a spare disk on the workstation and not the server!

jcoleman

Backup to harddisk
« Reply #3 on: February 15, 2005, 03:07:50 PM »
Quote from: "WEBlance"
I know this!!! I already tried to search this site for what I'm looking for!  Thanks for your answer, but it only describes how to backup to a spare disk on the workstation and not the server!


I'm not sure I understand your impatience.

Not everything comes spoon fed.  Assume that there is no specific howto for this.  Between the howto's to add another disk, and the howto's for rsync to "any" other disk, you should be able to get where you are going.  

If you have some specific questions, perhaps you should ask them?

-jeff

WEBlance

Backup to harddisk
« Reply #4 on: February 15, 2005, 04:22:00 PM »
Quote
I'm not sure I understand your impatience.

Not everything comes spoon fed.

Well, sorry about that! I didn't intend to give You the impression that I'm impatient and surtently not that I'm spoon fed. I've learned computing the hard way and I'm new at linux so it isn't always easy for me - but hey, we learn as long as we live  ;-)

Well - here's how it goes:

I looked at Your link and found this: http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/dmay/smeserver/5.x/howto/flexbackup-to-disk-howto.html
It describes how to mount a drive on a workstation and use this as a backup drive. Then it decribes how to configure flesbackup to use this drive.

I can see that I might be able to use fstab to mount a disk on the sme-box and use this in flexbackup instead of the remote drive.

Not quite shure how cause I'm still a newbie to linux but I'm thinking of something like this:

/dev/hdc /mnt/backup ext2 auto,user,rw 0 0

Is this totally wrong or am I going in the right direction??

And once again - sorry for the wrong impression! I'm very thankful for Your help!

/Carl[/i]

WEBlance

Backup to harddisk
« Reply #5 on: February 19, 2005, 12:01:35 AM »
I follwed the instructions in the howto. Instead of mounting a remote disk I mounted a local disk. Set the backup in the server-manager and waited for it to backup . . . but nothing happened!

Does anyone have any clue why?

/Carl

rmarshall

Backup to harddisk
« Reply #6 on: February 19, 2005, 01:56:52 AM »
Try "http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/aloveless/howtos/rsync_backup/SME_BackupServer.html"
I had done the same as what you are trying and would forget to run the script manually. I have since used the above howto and modified scripts for daily, weekly and monthly backups to an Accusys drive array with the scripts run with the crontab rpm. Good luck.

WEBlance

Backup to harddisk
« Reply #7 on: February 19, 2005, 08:44:27 PM »
rmarshall > did You try the same thing as I? I'm tryning to get my SME to backup to a harddrive instead of tape!

rmarshall

Backup to harddisk
« Reply #8 on: February 19, 2005, 09:56:28 PM »
Yes, with some mods to the scripts in the howto and adding the single drive as /dev/hdb mounted to /mnt I was able to backup my ibays or whatever I specified in the script. Now I know that the howto is backing up other networked machines but it works the same way. You're backing up DIR_DATA (what your backing up) to DIR_BACKUP_ROOT (the mount point of the backup hard drive). For a week setup you must use the number of the week (01-52), months will be the actual month names just as the days are in the script. With the crontab contrib you run the script it is actually pretty easy. There is a host of other stuff in the forums as well, search is your friend.

Offline Denbert

  • *
  • 156
  • +0/-0
    • hegnstoften.net
Backup to harddisk
« Reply #9 on: February 19, 2005, 10:02:32 PM »
Hi there,

I’m using a script from http://www.tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap29sec306.html

And are dropping the backup in an ibay – then I move the full backup every Monday to my XP box – It’s VERY simple and has saved me from a Disk Crash – Even my Domino Server was restored without any loss of data – below you will find my SME backup script:

------------------------------------------------------
#!/bin/sh
# full and incremental backup script
# created 11 october 2002
# Based on a script by Daniel O'Callaghan <danny[at]freebsd.org>
# and modified by Dennis Johansen <brascoe[at]hegnstoften.net>

#Change the 5 variables below to fit your computer/backup


COMPUTER=your_SME_Box                                  # name of this computer
DIRECTORIES=/home/e-smith/files/ibays/pub/files/dokumenter                         # directory to backup
BACKUPDIR=/home/e-smith/files/ibays/backups/files/dokumenter                             # where to store the backups
TIMEDIR=/home/e-smith/files/ibays/backups/files/dokumenter/last-full                   # where to store time of full backup
TAR=/bin/tar                                     # name and locaction of tar

#You should not have to change anything below here

PATH=/usr/local/bin:/usr/bin:/bin
DOW=date +%a                    # Day of the week e.g. Mon
DOM=date +%d                    # Date of the Month e.g. 27
DM=date +%d%b                # Date and Month e.g. 27Sep

# On the 1st of the month a permanet full backup is made
# Every Sunday a full backup is made - overwriting last Sundays backup
# The rest of the time an incremental backup is made. Each incremental
# backup overwrites last weeks incremental backup of the same name.
#
# if NEWER = "", then tar backs up all files in the directories
# otherwise it backs up files newer than the NEWER date. NEWER
# gets it date from the file written every Sunday.


# Monthly full backup
if [ $DOM = "01" ]; then
        NEWER=""
   $TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DM.tar $DIRECTORIES
Fi
      
# Weekly full backup
if [ $DOW = "Sun" ]; then
   NEWER=""
   NOW=date +%d-%b
            
   # Update full backup date
   echo $NOW > $TIMEDIR/$COMPUTER-full-date
   $TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DOW.tar $DIRECTORIES
                     
# Make incremental backup - overwrite last weeks
else
                     
       # Get date of last full backup
   NEWER="--newer cat $TIMEDIR/$COMPUTER-full-date"
   $TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DOW.tar $DIRECTORIES
Fi
------------------------------------------------------
/ Denbert
"Success is not final, failure is not fatal: it is the courage to continue that counts" - Sir Winston Churchill

WEBlance

Backup to harddisk
« Reply #10 on: February 22, 2005, 05:24:39 AM »
Thank You Denbert (tusind tak)

I've tryed the script but it doesn't work as it should. I got this message from cron:

/etc/cron.daily/backup.cron:

cat: /mnt/backup/last-full/server-full-date: No such file or directory
/bin/tar: Substituting 1970-01-01 00:59:59 for unknown date format -cf'
/bin/tar: You must specify one of the -Acdtrux' options
Try /bin/tar --help' for more information.

Don't know what to to - still a newbie!

My script file is like this:

#!/bin/sh
# full and incremental backup script
# created 07 February 2000
# Based on a script by Daniel O'Callaghan <danny@freebsd.org>
# and modified by Gerhard Mourani <gmourani@videotron.ca>

#Change the 5 variables below to fit your computer/backup

COMPUTER=server                              # name of this computer
DIRECTORIES="/home"                        # directoris to backup
BACKUPDIR=/mnt/backup                         # where to store the backups
TIMEDIR=/mnt/backup/last-full                 # where to store time of full backup
TAR=/bin/tar                               # name and locaction of tar

#You should not have to change anything below here

PATH=/usr/local/bin:/usr/bin:/bin
DOW=date +%a                    # Day of the week e.g. Mon
DOM=date +%d                    # Date of the Month e.g. 27
DM=date +%d%b                        # Date and Month e.g. 27Sep

# On the 1st of the month a permanet full backup is made
# Every Sunday a full backup is made - overwriting last Sundays backup
# The rest of the time an incremental backup is made. Each incremental
# backup overwrites last weeks incremental backup of the same name.
#
# if NEWER = "", then tar backs up all files in the directories
# otherwise it backs up files newer than the NEWER date. NEWER
# gets it date from the file written every Sunday.


# Monthly full backup
if [ $DOM = "01" ]; then
        NEWER=""
        $TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DM.tar $DIRECTORIES
fi

# Weekly full backup
if [ $DOW = "Sun" ]; then
        NEWER=""
        NOW=date +%d-%b

        # Update full backup date
        echo $NOW > $TIMEDIR/$COMPUTER-full-date
        $TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DOW.tar $DIRECTORIES

# Make incremental backup - overwrite last weeks
else

        # Get date of last full backup
        NEWER="--newer cat $TIMEDIR/$COMPUTER-full-date"
        $TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DOW.tar $DIRECTORIES
fi

Offline Denbert

  • *
  • 156
  • +0/-0
    • hegnstoften.net
Backup to harddisk
« Reply #11 on: February 22, 2005, 01:33:10 PM »
Quote from: "WEBlance"
Thank You Denbert (tusind tak)

I've tryed the script but it doesn't work as it should. I got this message from cron:

/etc/cron.daily/backup.cron:

cat: /mnt/backup/last-full/server-full-date: No such file or directory
/bin/tar: Substituting 1970-01-01 00:59:59 for unknown date format -cf'
/bin/tar: You must specify one of the -Acdtrux' options
Try /bin/tar --help' for more information.

Don't know what to to - still a newbie!

My script file is like this:

#!/bin/sh
# full and incremental backup script
# created 07 February 2000
# Based on a script by Daniel O'Callaghan <danny@freebsd.org>
# and modified by Gerhard Mourani <gmourani@videotron.ca>

#Change the 5 variables below to fit your computer/backup

COMPUTER=server                              # name of this computer
DIRECTORIES="/home"                        # directoris to backup
BACKUPDIR=/mnt/backup                         # where to store the backups
TIMEDIR=/mnt/backup/last-full                 # where to store time of full backup
TAR=/bin/tar                               # name and locaction of tar

#You should not have to change anything below here

fi


Hi again!

Please read my suggestion for a cron tab file.

You should first make a ibay e.g. backup this is now located in /home/e-smith/files/ibays/backup

Then chose witch dir to back up e.g.

DIRECTORIES=/home/e-smith/files/ibays/mp3/files

Then point where to put this backup:

BACKUPDIR=/home/e-smith/files/ibays/backup/files/mp3 – be sure to make this directory in the ibay

Then you need to make a time-dir, that checks with last full backup.

TIMEDIR=/home/e-smith/files/ibays/backup/files/mp3/last-full

Be sure to understand this detail http://www.tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap29sec306.html#AEN23634

If you still have problems, contact me in Danish at denbert[at]hegnstoften.net then I’ll make a Danish howto like this one : http://hegnstoften.net/howto/extra_harddisk/index_DK.htm

Skål
/ Denbert
"Success is not final, failure is not fatal: it is the courage to continue that counts" - Sir Winston Churchill