Skip to content

Instantly share code, notes, and snippets.

@gonter
Last active November 30, 2016 21:08
Show Gist options
  • Save gonter/b0383d7785bddc8e5809 to your computer and use it in GitHub Desktop.
Save gonter/b0383d7785bddc8e5809 to your computer and use it in GitHub Desktop.
MongoDB backup
dump/
201?????T??????.zip
Simple backup sdcrip for MongoDB
see https://gist.github.com/gonter/b0383d7785bddc8e5809
#!/bin/sh
b_dir='/home/backup/wekan'
b_date=`/bin/date +%Y%m%dT%H%M%S`
( mkdir -p $b_dir && cd $b_dir && /usr/bin/mongodump && /usr/bin/zip -mpr $b_date dump )
# now copy that zip to some other place, e.g. via scp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment