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:


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 4 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
4 comments… add one
  • Partha Chakraborty Jan 8, 2008 @ 7:08

    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 Nov 12, 2008 @ 8:03

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

  • sumit Oct 8, 2009 @ 6:42

    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 Jul 22, 2014 @ 13:11

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

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum