Posts

Showing posts from February, 2007

Linux - Tape Backup/Restore

SCSI tape drive

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

BACKUP
======


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:
#!/bin/sh
cat MyFiles > TempList
find /usr/share -iname *.png >> Tem…

Linux

Image
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

http://www.linux.org

Linux - Setting UTC or local time

# vi /etc/sysconfig/clock
UTC=false

Linux - Setting timezone

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

Linux - Change console color

Quoted from http://www.frozenblue.net/tools/howtos
/?v=redhat-8-console-fonts&op=printable

# 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.
COLOR tty

# 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.
OPTIONS -F -T 0

# 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)
EIGHTBIT 1

#…

Linux - CentOS yum repository

# vi /etc/yum.repos.d/dag.repo
> name=Dag RPM Repository for Red Hat Enterprise Linux
> baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
> gpgcheck=1
> enabled=1
# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt 


# cd /etc/yum.repos.d
# cp CentOS-Base.repo tnc-mirror.repo
# mv CentOS-Base.repo CentOS-Base.default
# vi tnc-mirror.repo
(Modify ftp://ftp2.tnc.edu.tw/pub1/centos...)
# rpm --import ftp://ftp2.tnc.edu.tw/pub1/centos/RPM-GPG-KEY-CentOS-4

Linux - CentOS T.Chi Display

# vi /etc/sysconfig/i18n
原內容是:
LANG="zh_TW.UTF-8"
SUPPORTED="zh_TW.UTF-8:zh_TW:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"
改成這樣:
LANG="zh_TW.Big5"
SUPPORTED="zh_TW.Big5:zh_TW.UTF-8:zh_TW:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"