SATOHOST
No Result
View All Result
Thứ Sáu, Tháng Một 22, 2021
  • Login
  • vps giá rẻ
  • cpanel nulled
  • bitcoin exchange script
  • Home 1
Subscribe
SATOHOST
  • vps giá rẻ
  • cpanel nulled
  • bitcoin exchange script
  • Home 1
No Result
View All Result
SATOHOST
No Result
View All Result
Home Blog

Solaris UNIX Tape Backup And Recovery With tar And cpio Commands

admin by admin
Tháng Sáu 3, 2019
in Blog
4 min read
0
152
SHARES
1.9k
VIEWS
Share on FacebookShare on Twitter

We have recently brought a new Sun Solaris UNIX server. How do I Backup data and make a recovery for the Solaris OS using tar and tape device?

It cannot be stressed enough how important it is to make a backup of your Solaris UNIX system. Most of the actions listed in this post are written with the assumption that they will be executed by the root user running the sh, ksh, or any other modern shell. Use the following tools to backup data to other server.

Sun Solaris UNIX Backup Commands

Sun Solaris UNIX comes with various commands and utilities to make a backup and recovery job:

a) tar command
b) cpio command

Important Directories and Files to Backup

  1. /export/home or /home (Home directory)
  2. /etc
  3. User mailboes
  4. Cron files (/var)
  5. MySQL and Oracle databases etc

Task: Use tar command to backup /data and /home directory

Usually /dev/rmt/0 is tape device name. To create a new tar file you can type the following command (backup /home/, /data/ and, /etc/file1 files to home.back.tar file) :
# tar cvf home-back.tar /home /data /etc/file1

To create a new tape backup use:

Backup /home and /data directory to /dev/rmt/0 tape device, enter:
# tar cvf /dev/rmt/0 /home /data

Task: Display the contents of a tar file/tape

Pass tvf option to a tar command:
# tar tvf home-back.tar
OR
# tar tvf /dev/rmt/0

Task: Restore files from tar file / tape

To extract the tar file to the current directory type:
# cd /
tar xvf home-back.tar
# tar xvf /dev/rmt/0

Understanding tar command options:

  • x : Extract tar file
  • v : Verbose
  • f : filename : Use to specify file name / tape device name
  • t : List tar file contents

Task: Backup files with cpio command

You can also use cpio command, which copies files into and out of a cpio archive. The cpio archive may span multiple volumes. The -i, -o, and -p options select the action to be performed. For example copy all *.c files to tape device or file called prog.cpio:
# ls *.c | cpio -oVc > /dev/rmt/0
OR
# ls *.c | cpio -oVc > prog.cpio

Task: Restore file using cpio

To copy from tape back to a directory, use the command as follows:
# cpio -icvD < /dev/rmt/0
OR
# cpio -icvum < /dev/rmt/0

Task: View the contents of cpio

Use the command as follows:
# cpio -ict < /dev/rmt/0

Understanding cpio command options:

  • i : (copy in) Reads an archive from the standard input and conditionally extracts the files contained in it and places them into the current directory tree.
  • c : Reads or writes header information in ASCII character form for portability.
  • t : Prints a table of contents of the input.
  • o : (copy out) Reads a list of file path names from the standard input and copies those files to the standard output in the form of a cpio archive.
  • v : Verbose
  • u : Use for an unconditional copy; old files will not replace newer versions.
  • m ; Retains previous file modification time.
  • d: Create as many directories as needed.

References:

  • Read Solaris tar, tape and cpio man pages, by typing following command:

man tar
man tape
man cpio

Share on Facebook Twitter

Posted by: SXI ADMIN

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Tags: blog
admin

admin

Related Posts

Blog

LINUX BACKUP & RESTORE FULL OS

Tháng Mười Hai 16, 2020
Blog

VPS Ram 4GB Chỉ 199k/tháng Miễn Phí Gsuite,

Tháng Tám 29, 2020
Blog

Tài Khoản Google Drive Unlimited 2020 50k – Google Drive Không Giới Hạn – Google drive unlimited 2020

Tháng Bảy 11, 2020
Bán tài khoản MOVO CASH USA ACCOUNT (VCC+VBA)
Blog

Bán tài khoản MOVO CASH USA ACCOUNT (VCC+VBA)

Tháng Bảy 11, 2020
Blog

Hướng dẫn kích hoạt bản quyền Windows Server 2012 R2 không cần crack

Tháng Sáu 10, 2020
Hướng dẫn cài đặt và cấu hình Openstack toàn tập từ A-Z
Blog

Hướng dẫn cài đặt và cấu hình Openstack toàn tập từ A-Z

Tháng Sáu 4, 2020
Hướng dẫn Tự Tạo Ứng Dụng Họp Online Phòng Học Online Miễn Phí với Jitsi
Blog

Hướng dẫn Tự Tạo Ứng Dụng Họp Online Phòng Học Online Miễn Phí với Jitsi

Tháng Tư 13, 2020
Hướng dẫn sử dụng Remote Desktop để truy cập VPS
Blog

Hướng dẫn sử dụng Remote Desktop để truy cập VPS

Tháng Tư 12, 2020
Download Kali Linux 2020.1
Blog

Download Kali Linux 2020.1

Tháng Tư 12, 2020
vps giá rẻ
  • Trending
  • Comments
  • Latest
Hướng dẫn cài DirectAdmin Nulled mới nhất 2020

Hướng dẫn cài DirectAdmin Nulled mới nhất 2020

Tháng Sáu 10, 2020
Wowza Streaming Engine 4.7.7 Crack Linux/Windows

Wowza Streaming Engine 4.7.7 Crack Linux/Windows

Tháng Mười Một 15, 2020
Nén và giải nén trong linux centos 6 centos 7 nén zip, tar.gz và tar.bz2.

Khuyến mãi vps 50k/tháng SSD 50Gb

Tháng Sáu 15, 2019
Bán tài khoản MOVO CASH USA ACCOUNT (VCC+VBA)

Bán tài khoản MOVO CASH USA ACCOUNT (VCC+VBA)

Tháng Bảy 11, 2020

Cpanel Nulled Cpanel/whm Nulled on Centos VPS/Dedicated Servers

Tháng Mười 8, 2020
Hướng dẫn cài đặt và cấu hình Openstack toàn tập từ A-Z

Hướng dẫn cài đặt và cấu hình Openstack toàn tập từ A-Z

Tháng Sáu 4, 2020

LINUX BACKUP & RESTORE FULL OS

0

Milestones & Timeline

0

The Economics of Websites

0

The Landing Page Guide

0

The Next Big Thing

0

UX Design Is Easy

0

LINUX BACKUP & RESTORE FULL OS

Tháng Mười Hai 16, 2020

VPS Ram 4GB Chỉ 199k/tháng Miễn Phí Gsuite,

Tháng Tám 29, 2020

Tài Khoản Google Drive Unlimited 2020 50k – Google Drive Không Giới Hạn – Google drive unlimited 2020

Tháng Bảy 11, 2020
Bán tài khoản MOVO CASH USA ACCOUNT (VCC+VBA)

Bán tài khoản MOVO CASH USA ACCOUNT (VCC+VBA)

Tháng Bảy 11, 2020

Hướng dẫn kích hoạt bản quyền Windows Server 2012 R2 không cần crack

Tháng Sáu 10, 2020
Hướng dẫn cài đặt và cấu hình Openstack toàn tập từ A-Z

Hướng dẫn cài đặt và cấu hình Openstack toàn tập từ A-Z

Tháng Sáu 4, 2020
  • vps giá rẻ
  • cpanel nulled
  • bitcoin exchange script
  • Home 1
Call us: 0975757375

© 2020

No Result
View All Result
  • vps giá rẻ
  • cpanel nulled
  • bitcoin exchange script
  • Home 1

© 2020

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In