Created
April 13, 2016 16:13
-
-
Save alvarow/39a065ddc35f0481f335a9487c647039 to your computer and use it in GitHub Desktop.
EC2 MongoDB Backup LVM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install lvm2 | |
pvcreate /dev/xvdf | |
pvs | |
vgcreate backups /dev/xvdf | |
lvcreate -n mongodb -l 100%FREE backups | |
mkfs.ext3 -L MONGOBACKUP /dev/backups/mongodb | |
echo '/dev/backups/mongodb /var/backups/mongodb ext3 defaults 1 2' >> /etc/fstab | |
mkdir -p /var/backups/mongodb | |
chmod 750 /var/backups/mongodb | |
mount /var/backups/mongodb | |
df -h | |
/etc/cron.daily/mongodb-backup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment