Databases

How to schedule a MongoDb backup using cron

If you are looking for a quite simple way to automate MongoDb backup using cron, here is one:

* 1 * * * DATE=`date +\%y/\%m/\%d/`; mkdir -p /mongo-backup/$DATE && mongodump --out /mongo-backup/$DATE

Notes:

  • Everyday at 01:00 am
  • Example path on 10th November 2014: /mongo-backup/14/11/10/
  • In the day folders, you will find a folder per database
  • In each database folder, you will find a JSON & BSON for each collection

MongoDB backup output

 

Read more about cron or mongodump

Standard
Dev Ops

Nginx: could not build the server_names_hash, you should increase server_names_hash_bucket_size

 

could not build the server_names_hash, you should increase server_names_hash_bucket_size

I got this error when I added a new host in the Nginx configuration file, but don’t worry, it’s very easy to fix it.

Just add the next line in the http block: Continue reading

Standard
Dev Ops

How to configure Nginx to serve statics from Amazon S3

Recently I needed to put a Nginx on front of a Amazon S3 bucket to serve statics files from a own subdomain and this is how I did it. Continue reading

Standard