[root@mysql books]# mongorestore -h 172.31.17.90:27017 --drop -d books --directoryperdb /data/ifly_temp/books
备份
./mongodump -h 172.16.46.12 -d books -o /data/ifly_backup/
bg 后台执行
-bash: bg: job 1 already in background
[root@mysql2 bin]# 2017-07-20T18:17:47.185+0800 Progress: 64380093118/144979209691 44% (bytes)
2017-07-20T18:17:50.374+0800 Progress: 64391643380/144979209691 44% (bytes)
2017-07-20T18:17:53.070+0800 Progress: 64395428591/144979209691 44% (bytes)
fg 后台转前台
./mongorestore -h 172.16.128.231 --port 27017 -d resources --directoryperdb /ziyuan/ah_hb_resource/mongobak20170708/resources/
2017-07-20T18:17:58.138+0800 Progress: 64396308782/144979209691 44% (bytes)
2017-07-20T18:18:01.177+0800 Progress: 64399344764/144979209691 44% (bytes)
2017-07-20T18:18:04.014+0800 Progress: 64414049516/144979209691 44% (bytes)
2017-07-20T18:18:07.054+0800 Progress: 64423828671/144979209691 44% (bytes)
2017-07-20T18:18:10.546+0800 Progress: 64438145393/144979209691 44% (bytes)
2017-07-20T18:18:13.008+0800 Progress: 64447946426/144979209691 44% (bytes)
2017-07-20T18:18:16.211+0800 Progress: 64459557918/144979209691 44% (bytes)
2017-07-20T18:18:19.219+0800 Progress: 64470423175/144979209691 44% (bytes)
2017-07-20T18:18:22.031+0800 Progress: 64480027362/144979209691 44% (bytes)
2017-07-20T18:18:28.776+0800 Progress: 64490600634/144979209691 44% (bytes)
2017-07-20T18:18:31.182+0800 Progress: 64500788206/144979209691 44% (bytes)
^Z (ctrl+z) 停止任务
[1]+ Stopped ./mongorestore -h 172.16.128.231 --port 27017 -d resources --directoryperdb /ziyuan/ah_hb_resource/mongobak20170708/resources/