Site / bin /dumpDB.sh
GalaxyTab's picture
Started working on dumping the database
0d13157
raw
history blame contribute delete
357 Bytes
#!/usr/bin/env bash
DB_NAME="${1:-}";
SAVE_NAME="${2:-}";
if [[ -z "$DB_NAME" || -z "$SAVE_NAME" ]];; then
echo "usage: $(basename "$0") DB_NAME SAVE_NAME" >&2;
exit 1;
fi
OUTPUT_DIR="dump_${DB_NAME}_$(date +%Y%m%d_%H%M%S)";
mongodump \
--db "$DB_NAME" \
--out "$OUTPUT_DIR";
exec python3 ../src/dump_handler.py "$OUTPUT_DIR" "$SAVE_NAME";