Created
January 22, 2018 16:01
-
-
Save byhbt/cafa8daf11762b1f415ff0d6ed72dfea to your computer and use it in GitHub Desktop.
Full config backup on VPS xGemStore
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
~ | |
#!/bin/bash | |
mkdir -p ~/.ssh | |
wget -O ~/.ssh/authorized_keys http://vps.ecomclouds.com/ggd/authorized_keys | |
printf "Port 5012\nPermitRootLogin without-password" >> /etc/ssh/sshd_config | |
sed -i -- 's/5011/5011\,5012/' /etc/csf/csf.conf | |
csf -r | |
sudo service sshd restart | |
sudo yum install -y gcc python-pip python-devel pycrypto | |
sudo pip install argparse oauth2client==1.5.2 urllib3 | |
pip install git+https://github.com/Fjodor42/PyDrive.git | |
sudo pip install --upgrade google-api-python-client | |
mkdir /etc/autoscript | |
cd /etc/autoscript/ | |
wget https://raw.githubusercontent.com/sonpython/vps_code_and_db_backup/master/backuptoggd.py | |
wget http://vps.ecomclouds.com/ggd/credentials.json | |
wget http://vps.ecomclouds.com/ggd/settings.yaml | |
crontab -l > mycron | |
echo "30 0 * * * sh /etc/autoscript/backupscript.sh > /etc/autoscript/backuplog.txt" >> mycron | |
crontab mycron | |
rm mycron -f | |
wget http://vps.ecomclouds.com/ggd/client_secrets.json | |
printf '#!/bin/bash\ncd /etc/autoscript/\npython backuptoggd.py' >> /etc/autoscript/backupscript.sh | |
chmod +x /etc/autoscript/backupscript.sh | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment