相信自己是对的,朋友多多才是走向成功的开始……

自己的事自己办!

统计

积分与排名

空间

网址

自己

最新评论

2009年8月8日 #

wget 是一个命令行的下载工具

wget 是一个命令行的下载工具。对于我们这些 Linux 用户来说,几乎每天都在使用它。下面为大家介绍几个有用的 wget 小技巧,可以让你更加高效而灵活的使用 wget。

  $ wget -r -np -nd example.com/packages/

  这条命令可以下载 example.com 网站上 packages 目录中的所有文件。其中,-np 的作用是不遍历父目录,-nd 表示不在本机重新创建目录结构。

  $ wget -r -np -nd --accept=iso example.com/centos-5/i386/

  与上一条命令相似,但多加了一个 --accept=iso 选项,这指示 wget 仅下载 i386 目录中所有扩展名为 iso 的文件。你也可以指定多个扩展名,只需用逗号分隔即可。

  $ wget -i filename.txt

  此命令常用于批量下载的情形,把所有需要下载文件的地址放到 filename.txt 中,然后 wget 就会自动为你下载所有文件了。

  $ wget -c example.com/really-big-file.iso

  这里所指定的 -c 选项的作用为断点续传。

  $ wget -m -k (-H) www.example.com/

  该命令可用来镜像一个网站,wget 将对链接进行转换。如果网站中的图像是放在另外的站点,那么可以使用 -H 选项。

wget

  开始:
  -V, --version 显示Wget版本之后退出。
  -h, --help 显示本帮助
  -b, --background 启动后转到后台运行。
  -e, --execute=COMMAND 运行 `.wgetrc'-那样的命令。
  日志和输入文件:
  -o, --output-file=FILE 将日志记录到文件 FILE.
  -a, --append-output=FILE 添加消息到文件 FILE.
  -d, --debug 输出大量调试信息。
  -q, --quiet 静默模式 (无输出)。
  -v, --verbose 显示信息 (默认打开).
  -nv, --no-verbose 显示很少信息但不是完全安静.
  -i, --input-file=FILE 下载存储在 FILE 文件中的所有URL地址指向的文件。
  -F, --force-html 把输入文件当成 HTML.
  -B, --base=URL prepends URL to relative links in -F -i file.
  下载:
  -t, --tries=NUMBER 设定重试次数(0 一直重试)。
  --retry-connrefused retry even if connection is refused.
  -O, --output-document=FILE 写入文档到 FILE.
  -nc, --no-clobber 跳过将要到已存在文件的下载。
  -c, --continue 续传下载。
  --progress=TYPE select progress gauge type.
  -N, --timestamping don't re-retrieve files unless newer than
  local.
  -S, --server-response 显示服务器的响应。
  --spider 什么都不下载
  -T, --timeout=SECONDS 把所有超时时间设为SECONDS秒。
  --dns-timeout=SECS 把DNS超时时间设为SECS秒。
  --connect-timeout=SECS 设定连接超时为 SECS.
  --read-timeout=SECS 设定读取超时为 SECS.
  -w, --wait=SECONDS wait SECONDS between retrievals.
  --waitretry=SECONDS wait 1..SECONDS between retries of a retrieval.
  --random-wait wait from 0...2*WAIT secs between retrievals.
  --no-proxy 显示关闭代理
  -Q, --quota=NUMBER set retrieval quota to NUMBER.
  --bind-address=ADDRESS bind to ADDRESS (hostname or IP) on local host.
  --limit-rate=RATE 把下载速度限制为RATE。
  --no-dns-cache 禁止查找DNS缓存。
  --restrict-file-names=OS restrict chars in file names to ones OS allows.
  --ignore-case ignore case when matching files/directories.
  -4, --inet4-only 仅连接IPv4地址。
  -6, --inet6-only 只连接到 IPv6 地址。
  --prefer-family=FAMILY connect first to addresses of specified family,
  one of IPv6, IPv4, or none.
  --user=USER 把ftp和http的用户名设定为UESR。
  --password=PASS 把ftp和http的密码设定为PASS。
  目录:
  -nd,--no-directories 不建立文件夹。
  -x,--force-directories 强制建立文件夹。
  -nH, --no-host-directories 不创建主机目录。
  --protocol-directories use protocol name in directories.
  -P, --directory-prefix=PREFIX 将文件保存到 PREFIX/...
  --cut-dirs=NUMBER ignore NUMBER remote directory components.
  HTTP 选项:
  --http-user=USER 将 http用户设为 USER.
  --http-password=PASS 将http密码设为 PASS.
  --no-cache 不接受服务器缓存的数据.
  -E,--html-extension 以'.html'扩展名保存HTML文档。
  --ignore-length ignore `Content-Length' header field.
  --header=STRING insert STRING among the headers.
  --max-redirect maximum redirections allowed per page.
  --proxy-user=USER 设定 USER 作为代理用户名。
  --proxy-password=PASS 设定 PASS 作为代理密码。
  --referer=URL include `Referer: URL' header in HTTP request.
  --save-headers 保存 HTTP 头到文件。
  -U, --user-agent=AGENT identify as AGENT instead of Wget/VERSION.
  --no-http-keep-alive disable HTTP keep-alive (persistent connections).
  --no-cookies 不使用cookies.
  --load-cookies=FILE 在会话前从文件中读取cookies。
  --save-cookies=FILE 在会话结束后保存 cookies 到 FILE。
  --keep-session-cookies load and save session (non-permanent) cookies.
  --post-data=STRING use the POST method; send STRING as the data.
  --post-file=FILE use the POST method; send contents of FILE.
  --content-disposition honor the Content-Disposition header when
  choosing local file names (EXPERIMENTAL).
  --auth-no-challenge Send Basic HTTP authentication information
  without first waiting for the server's
  challenge.
  HTTPS (SSL/TLS) 选项:
  --secure-protocol=PR choose secure protocol, one of auto, SSLv2,
  SSLv3, and TLSv1.
  --no-check-certificate don't validate the server's certificate.
  --certificate=FILE client certificate file.
  --certificate-type=TYPE client certificate type, PEM or DER.
  --private-key=FILE private key file.
  --private-key-type=TYPE private key type, PEM or DER.
  --ca-certificate=FILE file with the bundle of CA's.
  --ca-directory=DIR directory where hash list of CA's is stored.
  --random-file=FILE file with random data for seeding the SSL PRNG.
  --egd-file=FILE file naming the EGD socket with random data.
  FTP 选项:
  --ftp-user=USER 设置ftp用户为 USER.
  --ftp-password=PASS 设置ftp密码为 PASS.
  --no-remove-listing don't remove `.listing' files.
  --no-glob turn off FTP file name globbing.
  --no-passive-ftp disable the "passive" transfer mode.
  --retr-symlinks when recursing, get linked-to files (not dir).
  --preserve-permissions preserve remote file permissions.
  递归下载:
  -r, --recursive specify recursive download.
  -l, --level=NUMBER maximum recursion depth (inf or 0 for infinite).
  --delete-after delete files locally after downloading them.
  -k, --convert-links make links in downloaded HTML point to local files.
  -K, --backup-converted before converting file X, back up as X.orig.
  -m, --mirror shortcut for -N -r -l inf --no-remove-listing.
  -p, --page-requisites get all images, etc. needed to display HTML page.
  --strict-comments turn on strict (SGML) handling of HTML comments.
  Recursive accept/reject:
  -A, --accept=LIST comma-separated list of accepted extensions.
  -R, --reject=LIST comma-separated list of rejected extensions.
  -D, --domains=LIST comma-separated list of accepted domains.
  --exclude-domains=LIST 被拒绝的域名的用逗号分开的列表。
  --follow-ftp follow FTP links from HTML documents.
  --follow-tags=LIST comma-separated list of followed HTML tags.
  --ignore-tags=LIST comma-separated list of ignored HTML tags.
  -H, --span-hosts 当递归时转到陌生的主机。
  -L, --relative 只跟随相对链接。
  -I, --include-directories=LIST 允许的目录的列表。
  -X, --exclude-directories=LIST 不包括的目录的列表。
  -np, --no-parent don't ascend to the parent directory.

posted @ 2009-08-08 10:26 可冉 阅读(1603) | 评论 (1)编辑 收藏

2009年5月16日 #

KDUMP 加载不上怎么办呢

 kexec是一个快速启动机制,允许通过已经运行的内核的上下文启动一个Linux内核,不需要经过BIOS。BIOS可能会消耗很多时间,特别是带有众多数量的外设的大型服务器。这种办法可以为经常启动机器的开发者节省很多时间。


kdump是一个新的,而且非常可信赖的内核崩溃转储机制。崩溃转储数据可以从一个新启动的内核的上下文中获取,而不是从已经崩溃的内核的上下文。当系统崩溃时,kdump使用kexec启动到第二个内核。第二个内核通常叫做捕获内核(capture kernel),以很小内存启动,并且捕获转储镜像。


第一个内核保留了内存的一部分,第二个内核可以用来启动。注意,在启动时,kdump保留了一定数量的重要的内存,这改变了紅帽企业Linux 5最小内存需求。为了计算系统需要的真正最小内存,可以参看 http://www.redhat.com/rhel/details/limits/ 上列出的最小内存需求,加上kdump使用的内存数量,以决定真正的最小内存的需求。


因为第一个内核的内存内容已经被保留,所以kexec可以不经过BIOS,启动捕获内核。这是内核崩溃转储的根本。


怎样配置kdump


1.确认kexec-tools已经安装:

#rpm -q kexec-tools

2.配置/etc/kdump.conf文件,指定vmcore将被转储的路径。可以通过scp拷贝到另一个服务器,也可以是裸设备,或者本地的文件系统。


3.修改一些启动参数,为捕获很保留一块内存。对于i386和x86_64架构,编辑/etc/grub.conf,在内核行的末尾添加 crashkernel=128@16M。

下面是一个带有kdump选项的/etc/grub.conf文件:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/mlinuz-version ro root=/dev   a1
#          initrd /boot/initrd-version.img
#boot=/dev     a
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Client (2.6.17-1.2519.4.21.el5)
    

posted @ 2009-05-16 09:53 可冉 阅读(915) | 评论 (0)编辑 收藏

仅列出标题  下一页