Skip to content

Instantly share code, notes, and snippets.

View filliperomero's full-sized avatar
🚀
Always learning something new

Fillipe Romero filliperomero

🚀
Always learning something new
View GitHub Profile
@filliperomero
filliperomero / .zshrc
Created August 23, 2019 01:45 — forked from diego3g/.zshrc
SPACESHIP_PROMPT_ORDER=(
user # Username section
dir # Current directory section
host # Hostname section
git # Git section (git_branch + git_status)
hg # Mercurial section (hg_branch + hg_status)
exec_time # Execution time
line_sep # Line break
vi_mode # Vi-mode indicator
@filliperomero
filliperomero / mongodb_backup.md
Created July 6, 2019 23:01 — forked from baniol/mongodb_backup.md
MongoDB automatic backup

Maintaining even a small mongodb application in production requires regular backups of remotely stored data. MongoDB gives you three ways to acomplish it. In this post I'm using monogodump command for creating a backup and mongorestore for recreating the data. The purpose of this writing is to provide a simple way of periodic database dumps from a remote server to a Dropbox cloud storage.

Remember that for using mongodump you have to have a mongod process running.

Dumping a database

Suppose that you want make a backup of your books database.

To create a dump use mongodump -d books -o which will result in a book folder containing bson files with all collections.