StephenChan's Tech Space 潜心修炼

30Jan/100

ibbackup备份与恢复

1.备份

ibbackup备份的基本命令:

#ibbackup 传入两个配置文件的路径参数
ibbackup /path/to/my.cnf /path/to/my2.cnf
#典型的:
ibbackup /etc/my.cnf /home/mysql/backup-my.cnf

ibbackup会根据第一个参数中的my.cnf文件,获取需要备份的InnoDB的数据文件ibdata和日志文件ib_logfile的位置,并将其备份到第二个参数my2.cnf所指定的位置,ibbackup将读取第一个参数my.cnf中的如下内容:

datadir=...
innodb_data_home_dir=...
innodb_data_file_path=...
innodb_log_group_home_dir=...
innodb_log_files_in_group=...
innodb_log_file_size=...
#这里需要注意的是,很多的配置文件 my.cnf 中是没有 innodb_log_group_home_dir 和innodb_data_home_dir,这样ibbackup 会执行失败。

在第二个配置文件my2.cnf中的datadir、innodb_data_home_dir和innodb_log_group_home_dir是填写备份的目录,而且这些目录是要填写绝对路径的,因为ibbackup不识别这些文件中填写的相对路径。两个配置文件my.cnf和my2.cnf中关于数据文件的数量和大小设置必须相同,包括autoextend参数也要保持一致,而日志文件则可以不一样。

Filed under: MySQL Continue reading
28Jan/104

Crontab

Intro:

crontab  is  the  program used to install, deinstall or list the tables used to drive the cron(8) daemon in Vixie Cron.  Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly.

If the /etc/cron.allow file exists, then you must be listed therein in order to be allowed to use this command.  If the /etc/cron.allow file does not exist  but  the  /etc/cron.deny  file does exist, then you must not be listed in the /etc/cron.deny file in order to use this command.  If neither of these files exists, then depending on site-dependent configuration parameters, only the super user will be allowed to use this command, or all  users will be able to use this command. For standard Debian systems, all users may use this command.

Usage:

crontab [ -u user ] file
crontab [ -u user ] { -l | -r [ -i ] | -e }

The -l option causes the current crontab to be displayed on standard output. See the note under DEBIAN SPECIFIC below.

The -r option causes the current crontab to be removed.

The  -e option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables.  After you exit from the  editor, the modified crontab will be installed automatically.  If  neither  of  the  environment  variables  is  defined,  then  the  default  editor /usr/bin/editor is used.

The -i option modifies the -r option to prompt the user for a 'y/Y' response before actually removing the crontab.

Filed under: Linux Continue reading
26Jan/100

Moinmoin

一、简介

Moinmoin是一个高级,易用,可扩展的Wiki引擎,并且拥有比较大的用户群。Moinmoin是由Python编写的开源Wiki,详细的介绍请参考http://moinmo.in/

二、安装

Moinmoin有多种服务器配置方式,下面描述Moinmoin使用FastCGI的安装流程。

  1. http://moinmo.in/下载Moinmoin的安装包(示例使用的是1.8.5版 本),并解压出来,会看到有”setup.py”,”/wiki”,”/MoinMoin”等文件和目录。在Moinmoin中创建一个wiki实际是创 建了一个wiki的实例,也就是说对于一些静态的文件,如js,css,html等静态的内容,会被所有的wiki实例所共用,而每个wiki所特有的是 该wiki实例的数据文件和相关的配置文件等。把安装包解压之后,在解压的目录下运行”python setup.py install”把Moinmoin的库安装到本机的Python库中。
  2. 在解压出来的内容中,有一个wiki的目录,这个目录的内容就是Moinmoin的wiki所包含的所有文件了,其子目录如下:
    • data: 包含了wiki page和user data,只有Moinmoin才能访问;
    • underlay: 包含了Moinmoin默认的帮助页面和模板,只有Moinmoin才能访问;
    • htdocs: 包括了Moinmoin的静态支持文件,如js和css,Web服务器需要有权限访问此目录;
    • server: Moinmoin的一些示例启动文件;
    • config: Moinmoin的一些示例配置文件。

    新建一个目录存放wiki的data和underlay目录的文件(mkdir mywiki),然后把data和underlay两个目录拷到新创建的目录中(mywiki)。至于htdocs,存放的位置随意,但要保证Web服务器可以访问。

  3. 在mywiki目录新建一个目录用于存放Moinmoin的起动脚本(mkdir cgi-bin),并把server目录中的moin.cgi拷贝到cgi-bin目录,同时也把config目录中的wikiconfig.py文件拷 贝到mywiki的目录下,操作之后mywiki的目录结构如下:
    -/mywiki
    --/cgi-bin/moin.cgi
    --/data/
    --/underlay/
    --wikiconfig.py
Filed under: Tools Continue reading
26Jan/100

Graphviz

Graphviz是一个可以根据简单的描述语句生成图形的工具。这是AT&T Research的开源项目,其官方网站为http://www.graphviz.org, 官方网站提供了一些样图(http://www.graphviz.org/Gallery.php)。Graphviz可以在多平台下使用,包括 Linux,Windows, Max OS等等,如果觉得在非Windows下用Visio麻烦,那么Graphviz绝对是一个不错的选择。Graphviz的主要特性如下:

下载在这里(http://www.graphviz.org/Download.php),选择合适的系统和版本,在Ubuntu下也可以通过apt-get的方式安装(apt-get install graphviz),一般的源都有提供。安装完成之后可以通过控制台命令来进行图形生成。

Filed under: Tools Continue reading
25Jan/100

Debian Package系统学习小结

这里先介绍一下创建repository的步骤和apt-get命令的相关数据流程,以后有时间再将其他的细节补充。

一、创建repository

  • locate root direcotry, create pool
  • move binary and source packages to pool
  • generate Packages, Sources file (dpkg-scanpackages, dpkg-scansources)
  • create Release file and signature Release.gpg (apt-ftparchive, gpg)
  • publish repository : http, ftp, file

下面这个是创建repository的简单脚本:

Filed under: Linux Continue reading
Page 1 of 212