Deprecate backup of github projects

Since gogs can do that
This commit is contained in:
Bob Mottram 2015-12-01 15:01:34 +00:00
parent 15c9d3868e
commit 6fd4d2b084
1 changed files with 0 additions and 53 deletions

View File

@ -321,12 +321,6 @@ CREATE_GIT_PROJECT_COMMAND='create-project'
# File which keeps track of what has already been installed
COMPLETION_FILE=$HOME/freedombone-completed.txt
# Your github username
GITHUB_USERNAME=
# Directory where github projects will be backed up
GITHUB_BACKUP_DIRECTORY=/var/backups/github
# Used to indicate whether the backup contains MariaDB databases or not
BACKUP_INCLUDES_DATABASES="no"
@ -1076,12 +1070,6 @@ function read_configuration {
if grep -q "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE; then
ROUTER_IP_ADDRESS=$(grep "ROUTER_IP_ADDRESS" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "GITHUB_USERNAME" $CONFIGURATION_FILE; then
GITHUB_USERNAME=$(grep "GITHUB_USERNAME" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "GITHUB_BACKUP_DIRECTORY" $CONFIGURATION_FILE; then
GITHUB_BACKUP_DIRECTORY=$(grep "GITHUB_BACKUP_DIRECTORY" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "CPU_CORES" $CONFIGURATION_FILE; then
CPU_CORES=$(grep "CPU_CORES" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
@ -11339,46 +11327,6 @@ function create_git_project {
echo 'create_git_project' >> $COMPLETION_FILE
}
# Create daily backups of any projects on Github
# Then if Github goes away, turns evil, is censored or has
# outages then you still have access to your projects
function backup_github_projects {
if grep -Fxq "backup_github_projects" $COMPLETION_FILE; then
return
fi
if [ ! $GITHUB_USERNAME ]; then
return 731
fi
if [ ! $GITHUB_BACKUP_DIRECTORY ]; then
return 732
fi
apt-get -y install git
# create a github backups directory if needed
if [ ! -d $GITHUB_BACKUP_DIRECTORY ]; then
mkdir -p $GITHUB_BACKUP_DIRECTORY
fi
# get the backup utility
cd $INSTALL_DIR
git clone https://github.com/josegonzalez/python-github-backup
# install it
cd $INSTALL_DIR/python-github-backup
python setup.py install
# add a daily cron entry
echo '#!/bin/bash' > /etc/cron.daily/github
echo "github-backup $GITHUB_USERNAME -o $GITHUB_BACKUP_DIRECTORY --repositories" >> /etc/cron.daily/github
echo 'exit 0' >> /etc/cron.daily/github
chmod +x /etc/cron.daily/github
# do an initial backup
/etc/cron.daily/github
echo 'backup_github_projects' >> $COMPLETION_FILE
}
function check_date {
curr_date=$(date)
if [[ $curr_date == *"1970"* ]]; then
@ -11876,7 +11824,6 @@ set_your_domain_name
time_synchronisation
configure_internet_protocol
create_git_project
backup_github_projects
configure_ssh
remove_instructions_from_motd
check_hwrng