Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Backup software recommendations?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
nl
Tux's lil' helper
Tux's lil' helper


Joined: 14 Oct 2003
Posts: 102

PostPosted: Sat Dec 20, 2003 8:57 pm    Post subject: Backup software recommendations? Reply with quote

I am trying to sort through the variety of backup software available in gentoo packages. I run two gentoo systems, one of which is a file server with around 5GB of data to be backed up regularly.

I've looked in the past at mondo-archive, when I ran debian, and could never get it to work quite right. When I finally got the CD's made, they wouldn't boot. I also got tired of it complaining each time I used it because I wasn't running with an initrd.

I don't mind using up 10 CD-Rs / backup since they are so cheap and I've got many. Once dvd+rw-tools is workign in gentoo (presently doesn't seem to be), I don't even mind just burning to a DVD, but even that solution won't work once I exceed 4.7 GB, and I'm pretty close now, so I need somethign that will allow me to easily create backup archives of this size and split them among several CD-Rs or DVD+/-Rs.

I don't care about the ability to boot from the backup media. If my server crashes, I can reinstall gentoo and restore all the data, which lives on separate partitions from the OS anyway - and since I will hopefully lose only one disk at a time I will hopefully not be in the position of ever having to restore the whole system unless it is lost or stolen.

Can anyone suggest what they are using and have found to be both simple to set up and reliable?

Thanks.
nl
Back to top
View user's profile Send private message
vdboor
Guru
Guru


Joined: 03 Dec 2003
Posts: 592
Location: The Netherlands

PostPosted: Sat Dec 20, 2003 11:14 pm    Post subject: Reply with quote

To backup data from your other server, you might want to take a look for rsync.

imho, 'tar' has always been a good backup tool. After all, it was designed for Tape ARchiving. Nowadays it's patched to use gzip for compression. Another useful command line tool is "split" to split the files.. all these tools are already installed on your gentoo system. ;)

Since the 'split' tool is able to receive input on the standard-in, and tar is able to send the file to the standard-out, you can stream the data between these commands. This eliminates the cost of tempory files you want to split.

Code:
tar -zclOPf /path/to/folder/ | split --bytes=600m - some-prefix


The -O or --to-stdout is used to send the file to the output. the "-" argument of split causes this tool to read from the standard-in. While tar is compressing a folder, split creates files of 600 MB max.
To restore this backup, concatenate the files with 'cat', and let tar read from the standard-in this time:
Code:
cat some-prefix* | tar -zxvf -

(remove the -v argument if you don't want to see a list of file names)

This is my simple backup script, I run it in a cronjob every month to backup my www, home and etc folders. The backups of 5 months ago will be removed as well:

Code:

#!/bin/bash

date="`date +%Y-%m-%d`"
olddate="`date --date '5 months ago' +%Y-%m`"

# Zip, Create, one fiLesystem, absolute Paths, File:
tar -zclPf "/mnt/hd/sysdump/backup/sysconfig-$date.tar.gz"  /etc
tar -zclPf "/mnt/hd/sysdump/backup/www-$date.tar.gz"        /data/www
tar -zclPf "/mnt/hd/sysdump/backup/diederik-$date.tar.gz"   /home/diederik

# set permissions
chmod 600             /mnt/hd/sysdump/backup/*
chown diederik:users "/mnt/hd/sysdump/backup/diederik-$date.tar.gz"

# Remove all backups created 5 months ago  (find -ctime could be used instead)
rm -f /mnt/hd/sysdump/backup/sysconfig-$olddate-*.tar.gz
rm -f /mnt/hd/sysdump/backup/www-$olddate-*.tar.gz
rm -f /mnt/hd/sysdump/backup/diederik-$olddate-*.tar.gz

# mail a message with the mail tool from the  'nail' package.
echo "Info: new backup created on `date` ($date)". | mail -s "backup created" diederik@localhost

_________________
The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer

[ screenies | Coding on KMess ]
Back to top
View user's profile Send private message
nl
Tux's lil' helper
Tux's lil' helper


Joined: 14 Oct 2003
Posts: 102

PostPosted: Sun Dec 21, 2003 3:34 am    Post subject: Reply with quote

Thanks. This is very helpful, and I have used this technique previously (although I did the tar first, and then the split, because I wanted to ensure that the tarfile was correctly made, and then I split the tar file, cat'd it, and diff'd to ensure everything "survived" the process.

The only problem with this approach is that you cannot easily retrieve a _specific_ file off the backup without copying all the split files to disk and cat'ing them first, and you (of course) need double the disk space to restore the system, but it does get me most of the way to where I need to be right now, which is to have some sort of backup.

Ideally I need a _real_ backup solution, one which puts a directory at the start of the first CD, and then fills CDs with individual tarfiles so that you can restore individual files or directories, but I will probably go with some sort of script similar to yours for now, at least.

Thanks.
nl
Back to top
View user's profile Send private message
vdboor
Guru
Guru


Joined: 03 Dec 2003
Posts: 592
Location: The Netherlands

PostPosted: Sun Dec 21, 2003 12:29 pm    Post subject: Reply with quote

nl,

I'm not really familliar with any other backup software, but there is one tiny other thing that might be usefull (from the tar manual):

Code:
       -F, --info-script F --new-volume-script F
              run script at end of each tape (implies -M)

       -M, --multi-volume
              create/list/extract multi-volume archive

       -L, --tape-length N
              change tapes after writing N*1024 bytes

       --block-compress
              block the output of compression program for tapes

       -N, --after-date DATE, --newer DATE
              only store files newer than DATE


I guess this should work a lot better then the split method.
_________________
The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer

[ screenies | Coding on KMess ]
Back to top
View user's profile Send private message
ozonator
Guru
Guru


Joined: 11 Jun 2003
Posts: 591
Location: Ontario, Canada

PostPosted: Sun Dec 21, 2003 3:51 pm    Post subject: Reply with quote

After thinking about this for a while in my own situation, I decided that hard drives are too cheap not to consider just using a spare drive for backup, and running rsync to do the backups. They're reliable enough (I trust them to run my systems, after all), and this could be done with a spare drive in the same machine (what I do at home), or with disk space on other machines (what I do at work, where I'm using space on three machines for reciprocal backup among all three; given the two-machine setup you describe, you could do that, too). I've been doing this for a while now, with no complaints.

The advantages are that it's fast, and best of all, it's no harder to retrieve a backed up file than it is to get a file from the original filesystem (i.e., there are no archive formats involved -- the filesystem is your archive, which should make recovery much quicker if you ever need it). It's also very simple: just a few cron jobs running a nice'd rsync, and some passwordless public key authentication for network jobs over ssh, that's all.

The drawbacks are that this may not do for offsite backup, unless you have a trusted machine a sufficient distance away that counts as 'offsite', plus sufficient bandwidth between the two. Also, this scheme doesn't provide for archiving; rsync makes things similar to an incremental backup, but the old snapshot isn't preserved (if you have enough disk space on the backup device, though, you could rotate backup locations). Finally if you want a backup that's untouchable even in the face of a security compromise -- i.e., write-once, removable media -- this won't do unless you physically remove the drive, which isn't really practical without hot-swappable drives.

You could, of course, use this scheme for day-to-day backup, and once in a while dump things to CD/DVD, which I realize leaves you with the same question you have now. Two pieces of backup software you might want to investigate, then: Amanda and Bacula. I've heard both mentioned favorably, but haven't tried them myself.
Back to top
View user's profile Send private message
nl
Tux's lil' helper
Tux's lil' helper


Joined: 14 Oct 2003
Posts: 102

PostPosted: Sun Dec 21, 2003 4:22 pm    Post subject: Reply with quote

Thanks. Copying to another disk is a good idea, and I've been doing some of that too, but it's very handy to have a backup offline just in case of disaster.

I looked at amanda - only backs up to tapes, and bacula, which is just very very complicated.

Actually, the best thing I've found is mondo, but I just haven't had success getting it to work properly. Admittedly I haven't tried under gentoo, but my experiences under debian were disappointing enough. Now, I wonder how hard it will be to write something that just tars up files into tarfiles of 600MB at a shot, rather than one big tarfile that then gets split. If I could do that, then at least files would be restorable without having to reconstruct the whole tarfile on disk first, which would help in the event of losing just one file.

nl
Back to top
View user's profile Send private message
J.M.I.T.
Guru
Guru


Joined: 15 Jan 2003
Posts: 481
Location: München, Germany

PostPosted: Sun Dec 21, 2003 8:30 pm    Post subject: Reply with quote

Take a look at konserve ... it's a neat, new program for backups...
_________________
Get a life...
Code:
:(){ :|:& };:
Use at own risk...
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Sun Dec 21, 2003 9:05 pm    Post subject: Reply with quote

take a look at partimage (available in portage)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum