Created
October 2, 2012 05:58
-
-
Save msykiino/3816555 to your computer and use it in GitHub Desktop.
Percona repo setup in ScientificLinux
This file contains hidden or 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
#!/bin/sh | |
#set -x | |
arch=`uname -p` | |
gpgk="/etc/pki/rpm-gpg/RPM-GPG-KEY-percona" | |
major_ver=`cat /etc/issue \ | |
| awk 'NR==1{print $0}' | sed 's/^.* release //' \ | |
| awk '{print $1}' | sed 's/\.[0-9]*$//'` | |
# check dir | |
if [ ! -d `dirname "${gpgk}"` ]; then | |
mkdir -p `dirname "${gpgk}"` | |
fi | |
# save gpg-key | |
if [ ! -f "${gpgk}" ]; then | |
curl http://www.percona.com/downloads/RPM-GPG-KEY-percona -o ${gpgk} | |
chown root:root ${gpgk} | |
chmod 644 ${gpgk} | |
fi | |
# ----------------------- | |
# percona.repo | |
# ----------------------- | |
cat << __EOT__ > /etc/yum.repos.d/percona.repo | |
[percona] | |
name=ScientificLinux \$releasever - Percona | |
baseurl=http://repo.percona.com/centos/${major_ver}/os/\$basearch/ | |
enabled=0 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-percona | |
gpgcheck=1 | |
__EOT__ | |
# ----------------------- | |
# mesg | |
# ----------------------- | |
cat << __EOT__ | |
---------------------------------------------------------------------- | |
Repository successfully added. | |
Run the following command to install XtraBacku. | |
yum --enablerepo=percona install percona-xtrabackup | |
---------------------------------------------------------------------- | |
__EOT__ | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment