You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
BackupScripts/backup.sh

30 lines
1.1 KiB

#! /bin/bash
DATE=$(date +%m-%d-%Y)
if [ -f backup.env ]
then
export $(cat backup.env | sed 's/#.*//g' | xargs)
else
echo "Error, backup.env doesn't exist"
exit 1
fi
if [ -z "$DATE" ] || [ -z "$SCRIPT_LOCATION" ] || [ -z "$GITEA_EXE" ] || [ -z "$MF_DBHOST" ] || [ -z "$MF_DBPORT" ] || \
[ -z "$BACKUP_LOCATION" ] || [ -z "$MF_DBNAME" ] || [ -z "$MF_DBUSER" ] || [ -z "$MF_DBPASSWD" ] || [ -z "$NC_DBHOST" ] || \
[ -z "$NC_DIR" ] || [ -z "$NC_DBPORT" ] || [ -z "$NC_DBNAME" ] || [ -z "$NC_DBUSER" ] || [ -z "$NC_DBPASSWD" ] || \
[ -z "$LOG" ] || [ -z "$PB_DIR" ] || [ -z "$PROSODY_DBHOST" ] || [ -z "$PROSODY_DBPORT" ] || [ -z "$PROSODY_DBNAME" ] || \
[ -z "$PROSODY_DBUSER" ] || [ -z "$PROSODY_DBPASSWD" ]
then
echo "Error, please check your configuration in backup.env"
exit 2
fi
echo "" >> $LOG
echo "===== $DATE =====" >> $LOG
source $SCRIPT_LOCATION/gitea.sh >> $LOG
source $SCRIPT_LOCATION/miniflux.sh >> $LOG
source $SCRIPT_LOCATION/nextcloud.sh >> $LOG
source $SCRIPT_LOCATION/privatebin.sh >> $LOG
source $SCRIPT_LOCATION/prosody.sh >> $LOG