Mes Post-Its


mongodump backup distant

root@mediquizz:~# cat /root/mongodump.sh
ssh -L27018:localhost:27017 serveurabackuper.fr '
    echo "Connected on Remote End, sleeping for 10";
    sleep 10;
    exit' &
echo "Waiting 5 sec on local";
sleep 5;
echo "Connecting to Mongo and piping in script";

/usr/bin/mongodump --port 27018 --out /home/mongodbbackup/date +\%Y-\%m-\%d