LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2007, 12:30 PM   #1
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Rep: Reputation: 31
Question script for automatic backups


Here at work we are running a file server (Mac Xserve G5). We are using Exabyte to make backups, but we wanted a script that allows us to backup data from a HD to a USB HD and may also backup data to a remote server or another server in here. I have seen the automysqlbackup.sh shell script, but this is only to back up MySQL databases we want to backup folders full of important info.

Thanks for helping.
 
Old 03-28-2007, 12:41 PM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
I'd suggest looking into rsync for incremental backups - it's capable of backing up over a network (i.e. remotely) and also locally (for example to your external usb disk). There's loads of examples on the google of ways of backing up using rsync.

The advantage of rsync over tar, for example, is that it does incremental backups, only backing up new or changed data. This makes for a much more speedy backup whilst losing nothing in terms of data stored.

edit: having just checked the tar manpage, it seems it can do incremental backups too (-u switch) - every day's a school day!

Last edited by pwc101; 03-28-2007 at 12:43 PM.
 
Old 03-28-2007, 01:47 PM   #3
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
would rsync be useful for backing up to tapes as well as sending the backup to an remote server. Can this also notify us with an email?

thanks
 
Old 03-28-2007, 02:16 PM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
I'm not sure about rsync sending the data to a tape - I think that's more tar's job (tar = tape archiver). Sending that information to a tape would be a doddle:
Code:
 tar cf /dev/nst0 my_dir
if I remember correctly.

It depends largely on how you want the data stored - a tape is quite linear and difficult to manage, whereas a hard disk is much more versatile (and in my experience more reliable). However, if you're after backup redundancy (that is at least two different copies of the backup: 1 tape and 1 external disk (and possibly also a remote backup)), then the script will probably need to use a number of tool to accomplish this. These tools will be a combination of rsync (for the disk and network stuff) and tar for the tape backup. Written as a cron job, this process could be quite maintenance free.

Getting the script to notify you would be a quite trivial matter.
 
Old 03-28-2007, 05:09 PM   #5
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
How do I access the tape backup device? This is an exabyte connected thru firewire. I can not seem to identify it in the /dev directory
 
Old 03-29-2007, 04:23 AM   #6
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Are you running this on Linux or a Mac?

You could take a look at dmesg to see if there's any clues in there about the tape drive. I don't know how firewire devices are referred to in Linux as I've never used one before. Probably best to output dmesg through more or less:
Code:
dmesg | more
Looking at this link suggests that even a firewire tape drive, when connected to a Linux box and with the appropriate kernel compiled or kernel modules loaded, should be accessible as though it were a normal tape drive, through /dev/st0 or /dev/nst0.

To quickly check if your tape drive has already been picked up, try typing
Code:
cat /proc/scsi/scsi
into a terminal. I'm assuming here that you're running Linux; if you're not but are running OS X, try the cat command anyway, it might work!
 
Old 03-29-2007, 03:20 PM   #7
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
We are running Mac OS X server version 10.4.6. I was trying to install Rsyncx but I keep getting this error:

"there were errors installing the software. Please try again"

Can you suggest something else? a script that enables us to send a backup to a usb drive, remote machine and send an email notification.

thanks
 
Old 03-29-2007, 03:42 PM   #8
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Well, as far as I'm aware, rsync is your best bet. All a script would do is implement a number of programs, most likely rsync, tar, possibly cp, etc. and shunt the data over to the remote storage/tape drive/external disk. Depending on how robust you'd want to script to be, it wouldn't be a massive issue to learn how to do. There are plenty of tutorials on shell scripting which would teach you all you'd need to know in order to sort this problem. What's more, there are examples of people's scripts available for free, a simple google search of "backup external disk", or something along those lines, on www.google.com/linux, would almost certainly give you a few.

Browing some threads on this here at LQ, I came across a reference to bacula. It might be worth looking into as it says it's for Mac too, although it seems primarily for network backups.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic backups to DVD jerzakie Linux - Software 4 07-24-2006 01:39 PM
Script that automates backups using ftp linuxmandrake Programming 4 11-25-2005 05:12 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
cron script backups cbeach512 Linux - Newbie 1 01-06-2004 02:00 PM
Automatic Script micray Linux - Newbie 1 05-11-2002 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration