Command-line backup methods
The following is a brief overview of standard Unix comman-line utilities used for data backup on Solaris systems. Most of the information below is also applicable to other unixoid systems.
Common backup/copy methods:
tar | gzip
Basic syntax for creating *.tar.gz archive is:
tar cvf - . | gzip > target.tar.gzCommon tar options include:
-c: Create a tar file
-t: List the contents of a tar file
-x: Extract or restore a tar file
-v: VerboseExamples:
Create tar file of /etc/mail:
cd /etc tar cvf mail.tar mailExtract contents of mail.tar file to /backup/mail directory:
cd /backup tar xvf mail.tar
pax
Copy files from the current directory to tape:
pax -w -f /dev/rmt/0Show tape contents:
pax -v -f /dev/rmt/0
dd
dd is commonly used to copy disk slices and entire disks. Here’s an example that will copy disk c0t0d0 to the disk c0t1d0:
dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2 bs=128If you are looking to make a copy of the boot disk, check out this script.
ufsdump | ufsrestore
These two commands are used in concert to duplicate filesystems. Take a look at this script that uses ufsdump | ufsrestore to duplicate boot disks.
cpio
Copy /var and its contents to /var2:
find /var -depth -print | cpio -pudm /var2Copy directory and its contents to tape:
ls -R | cpio -oVc > /dev/rmt/0Copy tape backup back to directory:
cpio -icvD < /dev/rmt/0Copy directories and files contained in the “list” to tape:
cpio -ov list > /dev/rmt/0Restore data from tape while preserving timestamps:
cpio -icvum < /dev/rmt/0Read contents of the tape:
cpio -ict < /dev/rmt/0
volcopy (Solaris-specific)
This example will copy the /export/home filesystem from disk c0t0d0 to disk c0t0d1
volcopy -F ufs /export/home /dev/rdsk/c0t0d0s3 - /dev/rdsk/c0t0d1s3 -
WinRar v3.61 – Rar.Exe
Archive name : C:BackupAccounts.Exe
Files to be stored : E:Accounts*.* (also sub directories)
Archive format : Rar
Compression method : Best
Split to volumes : 700 mb
Update mode : Add & replace
Archiving options : Create SFX archive
Create solid archive
Put authenticity verification
Put recovery record
Test archive files
Lock archive
NTFS options : Save file security
Save file streams
File paths : Store full paths
Backup options : Clear attribute “Archive” after compressing
File time to store : Store last access time
Files to process : Of any time
Set archive time to : Latest file time
I have uploaded a .tar.gz file to a web server using FileZilla Client, but I want to know … is there a way to unzip/expand the file that I already uploaded? Because when I unzip it on the computer first it takes forever to upload. :(
Help please :) Thanks!
The commands are:
CP
CP –HELP