http://www.iwangzheng.com/
[[email protected]] $show dbs;
Changhong_tv_cms 0.078gb[[email protected]]$ mongodump-d changhong_tv_cms-o/temp/db_mongo.20140521.mongo/ workspace/db_baks$ scp-r-P 22022[email protected]:/temp/db_mongo_changhong.20140521.mongo./workspace/db_ baks$ Mongorestore--directoryperdbdb_mongo_changhong.20140521.mongo
$ mongodump--help
Options
--HELP Produce Help message
-V [--verbose] is more verbose (include multiple times for more
verbosity e.g.-VVVVV)
--version Print the program ' s version and exit
-h [--host] arg MONGO host to connect to (<set name>/s1,s2 for
Sets)
--port ARG server port. Can also use--host hostname:port
--ipv6 Enable IPV6 support (disabled by default)
-U [--username] arg username
-P [--password] arg password
--dbpath arg directly access Mongod database files in the given
Path, instead of connecting to a Mongod server-
Needs to lock the data directory, so cannot is used
If a mongod is currently accessing the same path
--directoryperdb if dbpath specified, each db was in a separate
Directory
--journal Enable journaling
-d [--DB] arg database to use
-c [--collection] arg collection to use (some commands)
-O [--out] arg (=dump) output directory or "-" for stdout
-Q [--query] arg JSON query
--oplog use Oplog for Point-in-time snapshotting
--repair try to recover a crashed database
--forcetablescan Force a table scan (does not use $snapshot)
-H Export Source
-d database name to export
The location to export the-o database