New changes

main
Anthony 2024-03-14 01:33:19 +08:00
parent 71b172aeac
commit f6db0d4dd9
1 changed files with 0 additions and 3 deletions

View File

@ -108,9 +108,6 @@ function create_snapshot(){
function backup(){ function backup(){
local backup_repo_path="/mnt/backups/${ENV_NAME}" local backup_repo_path="/mnt/backups/${ENV_NAME}"
echo $$ > "/var/run/${ENV_NAME}_backup.pid" echo $$ > "/var/run/${ENV_NAME}_backup.pid"
BACKUP_ADDON_REPO=$(echo "${BASE_URL}" | sed 's|https://raw.githubusercontent.com/||' | awk -F '/' '{print $1"/"$2}')
BACKUP_ADDON_BRANCH=$(echo "${BASE_URL}" | sed 's|https://raw.githubusercontent.com/||' | awk -F '/' '{print $3}')
BACKUP_ADDON_COMMIT_ID=$(git ls-remote "https://github.com/${BACKUP_ADDON_REPO}.git" | grep "/${BACKUP_ADDON_BRANCH}$" | awk '{print $1}')
echo "$(date) ${ENV_NAME} Creating the ${BACKUP_TYPE} backup (using the backup addon with commit id ${BACKUP_ADDON_COMMIT_ID})" | tee -a "${BACKUP_LOG_FILE}" echo "$(date) ${ENV_NAME} Creating the ${BACKUP_TYPE} backup (using the backup addon with commit id ${BACKUP_ADDON_COMMIT_ID})" | tee -a "${BACKUP_LOG_FILE}"
# Database credentials and dump # Database credentials and dump