#!/bin/bash
#DATA|TITLE|Esporta FreePlanet sul Server PCB
#DATA|DESCRIZ|Esporta FreePlanet in "exp_db_test.tar.gz" e lo invia sul Server PCB
#DATA|SOCK|false

DATABASE="FreePlanet"
FILEMONGODB="export_database_$DATABASE"
FILEZIP="exp_db_test.tar.gz"

source .my_cfg.ini

mongodump --db $DATABASE --authenticationDatabase admin -u admin -p $PWDDB --out $FILEMONGODB

tar cvfz $FILEZIP $FILEMONGODB

scp -P 8822 $FILEZIP pcbuser@pcb:~