Backing up Linux files to tape

Hi guys,
Im pretty new to backing up.
We have hooked up a tape unit to a a linux box, and I want to basically know how I can:

1) Backup the whole linux system (like a ghost image of the machine - if that is possible)

2) Backup selected directories and subdirectories to tape

3) Backup individual files to tape

4) How to schedule a task using cron to automate this

Ive heard that cpio is good. Will it backup open files?

Any help greatly appreciated.
Who is Participating?
cjl7freelance for hireCommented:

You probably wanna use /dev/nst0 (no-rewind scsi tape 0), if you don't you will overwrite your tape every night... Probably not what you want to do...

All though tar is a fine tool you might find amanda to be a better solution in the long run, it will keep track off versions for you and give you a "ftp-like" recovery shell.

Takes a bit of getting used to but well worth it in the end. (amanda is shipped with most distros)

my 2 cents...


1) cd / ; tar cvf /dev/st0 /

2) cd / ; tar cvf /dev/st0 /dir1 /dir2 /dir3/file1

3) cd / ; tar cvf /dev/st0 /path/to/file1 /path/to/file2

4) Simple way is to create a script in /etc/cron.daily, otherwise do 'crontab -e' and add an entry to run when you need.

5) Most people use tar for backups over cpio.  Both will backup open files.  tar will warn you of any files that change while it is backing them up.  
Simon336697Author Commented:
Hi Tintin!

Mate thank you so much for this. Can I please bother you further.

How would you do the following?

I want to backup these things every night to tape:

all files and subdirectories

all files and subdirectories

If the files are in use/open, I dont want to be prompted (as it is being backed up to tape and i wont be there)

Id like a log made each night of the backup task.

I dont want to use any 3rd party software to backup to tape, so I imagine cpio or tar can backup directly to tape?

Id basically like the backup to be a full backup.

Sorry to ask all these timeline of learning this is short.

Thank you.

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

You just need

tar cf /dev/st0 /vmconfigs >>/var/log/backup.log 2>&1

I'm assuming /dev/st0 is your tape device (is on most Linux systems).

cjl7freelance for hireCommented:
Hi again,

I saw your question about open files...

If it is a database file (i.e. oracle, MySQL, postgresql...) DO NOT back up the database file and think it will be any use to you...

Other then that Linux doesn't suffer from the "open files" problem as much as windows...

Simon336697Author Commented:
Thanks guys!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.