Backing up Linux files to tape

Posted on 2005-04-07
Medium Priority
Last Modified: 2010-04-20
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.
Question by:Simon336697
  • 2
  • 2
  • 2
LVL 48

Expert Comment

ID: 13733075

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.  

Author Comment

ID: 13733105
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 things....my timeline of learning this is short.

Thank you.

LVL 48

Assisted Solution

Tintin earned 1000 total points
ID: 13733264
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).

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 14

Accepted Solution

cjl7 earned 1000 total points
ID: 13735379

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...

LVL 14

Expert Comment

ID: 13735395
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...


Author Comment

ID: 13772231
Thanks guys!!!

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question