Created
June 1, 2015 20:17
-
-
Save akrzos/91ebf668c3039b57992a to your computer and use it in GitHub Desktop.
Create satellite 6.1 backup with synced content
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
export BDIR=/home/backup/(create name of "backup" here) | |
mkdir -p $BDIR | |
chmod 770 $BDIR | |
chgrp postgres $BDIR | |
cd $BDIR | |
katello-service stop | |
service foreman-proxy stop | |
sync; sync; echo 3 > /proc/sys/vm/drop_caches | |
tar --selinux -cvf pulp_data.tar /var/lib/pulp /var/www/pub | |
service mongod start | |
sleep 5 | |
mongodump --host localhost --out $BDIR/mongo_dump | |
service mongod stop | |
service postgresql stop | |
sync; sync; echo 3 > /proc/sys/vm/drop_caches | |
service postgresql start | |
su postgres -c "pg_dump -Fc candlepin > $BDIR/candlepin.dump" | |
su postgres -c "pg_dump -Fc foreman > $BDIR/foreman.dump" | |
su postgres -c "pg_dump -Fc gutterball > $BDIR/gutterball.dump" | |
df -h >> $BDIR/df-h | |
df >> $BDIR/df | |
service foreman-proxy start | |
katello-service start | |
cd ~ | |
hammer -u admin -p changeme ping |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment