≡ Menu

Backup Home Directories in Linux

Q. I would like to Backup all directories in /home to /dev/st0 tape drive. How do I use script to automate task and what commands do I need to use?

A. Use tar command to backup /home directory. The GNU version of the tar archiving utility included with all Linux distributions. Following tar command also works with Solaris/HP-UX UNIX and FreeBSD/*BSD oses.

For example tar command to backup /home should be as follows:
# tar -czf /dev/st0 /home

Where,

  1. /dev/st0 : Linux SCSI Tape device name
  2. /home : Home directory name

This will also backup hidden files and directories. Since this topic is already covered, please refer scripts and previous posts:

Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:



{ 4 comments… add one }
  • Partha Chakraborty January 8, 2008, 7:08 am

    This site is extremely helpful in learning scsi tape backup in Linux. I wish you good luck and thank you all for the help.

  • Imran Said November 12, 2008, 8:03 am

    This site helped me lots. thanks for all this brilliant effort.

  • sumit October 8, 2009, 6:42 am

    i had tried to take backup of whole system , backup has started but there is not any messages apperas after finishing the backup after taking servral hours

  • lol July 22, 2014, 1:11 pm

    This does not backup /home it backups the tape drive..

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: , , , , , , , , , ,