Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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!
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.
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.