通过SSH执行备份

以下将本机的文件备份到远程服务器server1
tar cvfz - /home | server1 "cat > client-home.tar.gz"
也可以将压缩的存档文件直接写入到远程服务器的磁带驱动器
tar cvfz - /home | ssh server1 "cat > /dev/tape"
同步本地目录结构到另一台服务器
假设远程服务器的apache目录损坏,准备从本地服务器通过到远程服务器上:
cd /usr/local;tar zcf - apache/ | ssh server1 "cd /usr/local; mv apache apache.bak; tar zpxvf -"
将本地备份压缩包恢复到远程服务器
本地有备份的压缩包需要恢复到远程服务器(假设该文件包很大,本地没有空间可以 提供解压缩)
ssh server1 "cd /usr/local/data; tar zpvxf -" < really-big-archive.tgz
反向做也是可以的(在服务器上反向从客户端取文件)
ssh client1 "cat really-big-archive.tgz" | tar zpvxf -
备份远程服务器目录到本地成为压缩包 将服务器的/home/chroot目录备份到本地成为 chroot.tar.gz
ssh root@192.168.9.23 "cd /home; tar cfz - chroot" > chroot.tar.gz
使用dd命令进行远程备份
以下是通过dd命令通过ssh方式复制卷到另外一台服务器的卷
dd if=/dev/VGvms/LVwinxp | ssh 192.168.9.201 "dd of=/dev/VGvms/LVwinxp"

原文:http://goo.gl/sSJsL

mysqldump详解

命令位于 /bin/ 目录中,现有环境有两台 服务器,一台 IP 为: 192.168.102.2 另一台 192.168.102.3
( 1 )完整备份 MySQL 的某个数据库
mysqldump –h hostname –u username –p password databasename > backupfile.sql
例如:将 192.168.102.2 服务器上的 book 数据库备份到 192.168.102.3
mysqldump -h 192.168.102.2 -u backup -p book >book.sql
( 2 ) MySQL 数据库为带删除表的格式
备份 MySQL 数据库为带删除表的格式,能够让该备份覆盖已有数据库而不需要手动删除原有数据库。 这样可以保证导回 MySQL 数据库的时候不会出错,因为每次导回的时候,都会首先检查表是否存在,存在就删除

例如:将 192.168.102.2 服务器上的 book 数据库备份到 192.168.102.3
mysqldump -–add-drop-table -h hostname –u username –p password databasename > backupfile.sql
例如:将 192.168.102.2 服务器上的 book 数据库备份到 192.168.102.3
mysqldump --add-drop-table -h 192.168.102.2 -u backup -p book >book.sql
(3) 直接将 MySQL 数据库压缩备份
mysqldump –h hostname –u username –p password databasename | gzip > backupfile.sql.gz
例如:将 192.168.102.2 服务器上的 book 数据库压缩备份到 192.168.102.3 服务器
mysqldump -h 192.168.102.2 -u backup -p book | gzip >book.sql
( 4 )备份 MySQL 数据库某个 ( 些 ) 表
mysqldump –h hostname –u username –p password databasename specific_table1 specific_table2 > backupfile.sql
例如:将 192.168.102.2 服务器上的 backup 数据库中的 books 和 orders 表备份到 192.168.102.3 服务器
mysqldump -h 192.168.102.2 -u backup -p backup books orders>book.sql
( 6 )仅仅备份数据库结构
mysqldump --no-data –h hostname –u username –p password –d databasename1 databasename2 databasename3 >structurebackupfile.sql
例如:仅将 192.168.102.2 服务器上的 backup 数据库的表结构备份到 192.168.102.3 服务器
mysqldump --no-data -d backup -h 192.168.102.2 -u backup -p >book.sql

(7) 备份指定条件的数据
例如只想把服务器 192.168.102.2 上的数据库 test 中的表 test 中的 id>1 的内容备份,可以使用下面的命令:
mysqldump -h 192.168.102.2 -u backup -p test test --where "id>1">test.sql
( 8 )还原 MySQL 数据库的命令
mysql –h hostname –u username –p password databasename < backupfile.sql
( 9 )还原压缩的 MySQL 数据库
gunzip < backupfile.sql.gz | mysql –u username –p password databasename
mysqldump 工具有大量的选项,部分选项如下:

–add-drop-table : 这个选项将会在每一个表的前面加上 DROP TABLE IF EXISTS 语句,这样可以保证导回 MySQL 数据库的时候不会出错,因为每次导回的时候,都会首先检查表是否存在,存在就删除

–add-locks : 这个选项会在 INSERT 语句中捆上一个 LOCK TABLE 和 UNLOCK TABLE 语句。这就防止在这些记录被再次导入数据库时其他用户对表进行的操作

-c or – complete_insert : 这个选项使得 mysqldump 命令给每一个产生 INSERT 语句加上列( field )的名字。当把数据导出导另外一个数据库时这个选项很有用。

–delayed-insert 在 INSERT 命令中加入 DELAY 选项

-F or -flush-logs 使用这个选项,在执行导出之前将会刷新 MySQL 服务器的 log.

-f or -force 使用这个选项,即使有错误发生,仍然继续导出

–full 这个选项把附加信息也加到 CREATE TABLE 的语句中

-l or -lock-tables 使用这个选项,导出表的时候服务器将会给表加锁。

-t or -no-create- info : 这个选项使的 mysqldump 命令不创建 CREATE TABLE 语句,这个选项在您只需要数据而不需要 DDL (数据库定义语句)时很方便。

-d or -no-data 这个选项使的 mysqldump 命令不创建 INSERT 语句。 在您只需要 DDL 语句时,可以使用这个选项

–opt 此选项将打开所有会提高文件导出速度和创造一个可以更快导入的文件的选项。

-q or -quick 这个选项使得 MySQL 不会把整个导出的内容读入内存再执行导出,而是在读到的时候就写入导文件中。

-T path or -tab = path 这个选项将会创建两个文件,一个文件包含 DDL 语句或者表创建语句,另一个文件包含数据。 DDL 文件被命名为 table_name.sql, 数据文件被命名为 table_name.txt. 路径名是存放这两个文件的目录。目录必须已经存在,并且命令的使用者有对文件的特权。

-w “WHERE Clause” or -where = “Where clause ” : 如前面所讲的,您可以使用这一选项来过筛选将要放到 导出文件的数据。

假定您需要为一个表单中要用到的帐号建立一个文件,经理要看今年( 2004 年)所有的订单( Orders ),它们并不对 DDL 感兴趣,并且需要文件有逗号分隔,因为这样就很容易导入到 Excel 中。 为了完成这个人物,您可以使用下面的句子: bin/mysqldump – p – where "Order_Date >='2000-01-01'" – tab = /home/mark – no-create-info – fields-terminated-by=, Meet_A_Geek Orders
原文转自:不详

解决”Sorry, but you don’t have the administrative privileges needed to do this.”的方法

把//wp-content/themes/THEMENAME/core/admin/options.class.php中

//if(!isset($_GET['activated'])) checkauthority();

注释掉 checkauthority这行就可以了

原文:http://goo.gl/7k7vu

SourceForge Interactive Shell Service – SSH

Interactive Service

Project developers can access an Interactive Shell if they have been granted shell access for the project. The Interactive Shell provides a command line interface that can be used to manage the following:

  • Project web content
  • Developer web content
  • Project uploads
  • CVS repositories

Features

The Interactive Shell supports the following features:

  • shell access to project content; access to data for other users and projects not provided
  • Comprehensive set to command line tools
  • 4 hour shell life – shells are automatically terminated after 4 hours.
  • Password or SSH keys authentication
  • CVS repository administration

The Interactive Shell does not support the following features:

  • Cron service
  • File management service

Management

Project members must be granted shell access by a project administrator. Project administrators can grant Shell Access to project members on the project membership page (select Membership in the Project Admin menu).

Access

Interactive Shell sessions persist for 4 hours once created. Authorized developers that have been granted shell access for a project can create/connect to an Interactive Shell with:

ssh -t USER,PROJECT@shell..net create

NOTE: Be sure to substitute your SourceForge.net login username for USER, and the respective SourceForge.net project UNIX name for PROJECT.

If you do not have an active Interactive Shell session a help page can be viewed with:

ssh USER@shell.sourceforge.net

Accessing Project web content

Users who are a member of a project and want to access their Project web content need to use the above method to connect and then change to the appropriate directory (replacing with your own Project Name):

/home/project-web/ProjectName/htdocs/

Accessing Developer Web Content

Users who are a member of a project and want to access their Developer web content need to use the above method to connect and then change to the appropriate directory (replacing with your own Username):

/home/user-web/Username/htdocs/

PuTTY client

For those using the PuTTY SSH client, set the following settings for the PuTTY session:

Note: In Windows Vista or Windows 7, it may be necessary to run PuTTY in Windows XP compatibility mode.

Session Host Name: “shell.sourceforge.net
Session Connection Type: “SSH
Connection > SSH Remote command: “create
Connection > Data Auto-login username: “USER,PROJECT
  • Open the session and provide your password at the prompt.

Note: If you get disconnected after shell creation, in Connection > SSH > TTY uncheck the box for “Don’t allocate a pseudo-terminal”

SSH Key Authentication

If a user has set up SSH keys, they can be used to authenticate to an Interactive Shell session. Please see the following for more information on setting up SSH keys:

Use the ‘-i’ option to pass your private key file to the ssh command:

ssh -i PATH-TO-PRIV-KEY -t USER,PROJECT@shell.sourceforge.net create

国内外DNS服务器列表

港澳台DNS服务器地址

香港:
205.252.144.228
208.151.69.65
202.181.202.140
202.181.224.2

澳门:
202.175.3.8
202.175.3.3

台湾:
168.95.192.1
168.95.1.1

国外DNS服务器地址

美国:
208.67.222.222
208.67.220.220
165.87.13.129
165.87.201.244
205.171.3.65
205.171.2.65
198.41.0.4
198.41.0.4
198.32.64.12
192.33.4.12
192.203.230.10
192.5.5.241
192.112.36.4
192.36.148.17
192.58.128.30
192.9.9.3
193.0.14.129
128.9.0.107
128.8.10.90
66.33.206.206.
208.96.10.221
66.33.216.216
205.171.3.65
205.171.2.65
165.87.13.129
165.87.201.244

加拿大:
209.166.160.36
209.166.160.132

英国:
193.0.14.129

日本
202.12.27.33
202.216.228.18

韩国:
164.124.101.31
203.248.240.31
168.126.63.60
168.126.63.61

新西兰:
202.27.184.3

泰国:
209.166.160.132
202.44.8.34
202.44.8.2

印度:
202.138.103.100
202.138.96.2

国内各省市DNS服务器地址

北京:
202.96.199.133
202.96.0.133
202.106.0.20
202.106.148.1
202.97.16.195
202.138.96.2

深圳:
202.96.134.133
202.96.154.15

广州:
61.144.56.100
61.144.56.101

广东:
202.96.128.86
202.96.128.143

上海:
202.96.199.132
202.96.199.133
202.96.209.5
202.96.209.133

天津:
202.99.96.68
202.99.104.68

广西:
202.96.128.68
202.103.224.68
202.103.225.68

河南:
202.102.227.68
202.102.245.12
202.102.224.68

河北:
202.99.160.68

福建:
202.101.98.54
202.101.98.55

厦门:
202.101.103.55
202.101.103.54

湖南:
202.103.0.68
202.103.96.68
202.103.96.112

湖北:
202.103.0.68
202.103.0.117
202.103.24.68

江苏:
202.102.15.162
202.102.29.3
202.102.13.141
202.102.24.35

浙江:
202.96.102.3
202.96.96.68
202.96.104.18

陕西:
202.100.13.11
202.100.4.16
202.100.4.15
202.100.0.68

山东:
202.102.154.3
202.102.152.3
202.102.128.68
202.102.134.68

山西:
202.99.192.68
202.99.198.6

四川:
202.98.96.68
61.139.2.69

重庆:
61.128.128.68

成都:
202.98.96.68
202.98.96.69

辽宁:
202.98.0.68
202.96.75.68
202.96.75.64
202.96.69.38
202.96.86.18
202.96.86.24

安徽:
202.102.192.68
202.102.199.68
10.89.64.5

吉林:
202.98.5.68
202.98.14.18
202.98.14.19

江西:
202.101.224.68
202.109.129.2
202.101.240.36

新疆:
61.128.97.74
61.128.97.73

贵州:
202.98.192.68
10.157.2.15

云南:
202.98.96.68
202.98.160.68

黑龙江:
202.97.229.133
202.97.224.68
219.150.32.132

海南:
202.100.192.68
202.100.199.8

宁夏:
202.100.0.68
202.100.96.68

甘肃:
202.100.72.13

内蒙古:
202.99.224.68

青海:
202.100.128.68

全球路由DNS服务器

全球只有13台路由DNS根服务器,在13台路由服务器中,名字分别为“A”至“M”,其中10台设置在美国,另外各有一台设置于英国、瑞典和日本。下表是这些机器的管理单位、设置地点及最新的IP地址。

名称  管理单位及设置地点    IP地址
A INTERNIC.NET(美国,弗吉尼亚州) 198.41.0.4
B 美国信息科学研究所(美国,加利弗尼亚州) 128.9.0.107
C PSINet公司(美国,弗吉尼亚州) 192.33.4.12
D 马里兰大学(美国马里兰州) 128.8.10.90
E 美国航空航天管理局[NASA](美国加利弗尼亚州) 192.203.230.10
F 因特网软件联盟(美国加利弗尼亚州) 192.5.5.241
G 美国国防部网络信息中心(美国弗吉尼亚州) 192.112.36.4
H 美国陆军研究所(美国马里兰州) 128.63.2.53
I Autonomica公司(瑞典,斯德哥尔摩) 192.36.148.17
J VeriSign公司(美国,弗吉尼亚州) 192.58.128.30
K RIPE NCC(英国,伦敦) 193.0.14.129
L IANA (美国,弗吉尼亚州) 198.32.64.12

Protected: 有这么个国家

This post is password protected. To view it please enter your password below:


Protected: 解决CJB的SSH帐号无法正常登陆(不只换IP)

This post is password protected. To view it please enter your password below: