Showing posts from February, 2007

Linux - Tape Backup/Restore

SCSI tape drive

Rewind : /dev/st0
No-Rewind : /dev/nst0


Backup directory /www and /home with tar command (z - compressed):
# tar -czf /dev/st0 /www /home

To back up the entire file system using tar to a SCSI tape drive, excluding the /proc directory:
# tar -cpf /dev/st0 / --exclude=/proc

(-p switch indicates that we want to preserve the file permissions)
(-M switch, for multi-volume if the backup will not fit on a single tape)

The following line backs up all the files and directories listed in MyFiles, the /root directory, and all of the iso files in the /tmp directory:
# tar -cpf /dev/st0 -T MyFiles /root /tmp/*.iso

(-T switch, put the files and directories that you want to archive in a text file)
(note that the tar -T (or files-from) command cannot accept wildcards. Files must be listed explicitly.)

You could also execute a script to search the system and then build a list. Here is an example of such a script:
cat MyFiles > TempList
find /usr/share -iname *.png >> Tem…


Linux is a free Unix-type operating system originally created by Linus Torvalds with the assistance of developers around the world. Developed under the GNU General Public License , the source code for Linux is freely available to everyone. Click on the link below to find out more about the operating system that is causing a revolution in the world of computers

Linux - Setting UTC or local time

# vi /etc/sysconfig/clock

Linux - Setting timezone

# ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime

Linux - Change console color

Quoted from

# vi $HOME/.dir_colors# Configuration file for the color ls utility
# COLOR needs one of these arguments: 'tty' colorizes output
# to ttys, but not pipes. 'all' adds color characters to
# all output. 'none' shuts colorization
# off.

# Extra command line options for ls go here.
# Basically these ones are:
# -F = show '/' for dirs, '*' for executables, etc.
# -T 0 = don't trust tab spacing when formatting ls output.

# Below, there should be one TERM entry for each
# termtype that is colorizable
TERM linux
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM xterm
TERM rxvt
TERM xterm-color
TERM color-xterm
TERM vt100
TERM dtterm
TERM color_xterm

# EIGHTBIT, followed by '1' for on, '0' for off.
# (8-bit output)


Linux - CentOS yum repository

# vi /etc/yum.repos.d/dag.repo
> name=Dag RPM Repository for Red Hat Enterprise Linux
> baseurl=$releasever/en/$basearch/dag
> gpgcheck=1
> enabled=1
# rpm --import 

# cd /etc/yum.repos.d
# cp CentOS-Base.repo tnc-mirror.repo
# mv CentOS-Base.repo CentOS-Base.default
# vi tnc-mirror.repo
# rpm --import

Linux - CentOS T.Chi Display

# vi /etc/sysconfig/i18n