Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #!/bin/bash
  2. db=<db>
  3. collection_list="<collection1> <collection2> <collection3>"
  4. host=127.0.0.1
  5. port=<port>
  6.  
  7. out_prefix=/Temp
  8. for collection in $collection_list; do
  9. echo $collection
  10. out_dir="${out_prefix}/${db}_${collection}/"
  11. mkdir -p ${out_dir}
  12. mongodump --host $host --port $port --collection $collection --db $db --out ${out_dir}
  13. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement