Compare commits
No commits in common. "21a161ccfc72be022e5c5eff0500ea6d4abe6343" and "502c4d156ff14fd8d6c2d07a6fde2c4759c0dfac" have entirely different histories.
21a161ccfc
...
502c4d156f
2 changed files with 2 additions and 40 deletions
|
@ -2,13 +2,8 @@
|
|||
|
||||
FORGEJO_MYSQL_CONTAINER="forgejo-db"
|
||||
BACKUP_DIRECTORY="$HOME/backups_to_download/forgejo/"
|
||||
source "$HOME/.env"
|
||||
source $HOME/.env
|
||||
|
||||
echo "INFO Creating compressed backup of ${FORGEJO_MYSQL_CONTAINER}"
|
||||
|
||||
rm "$HOME/backups/forgejo/*"
|
||||
|
||||
sleep 1
|
||||
|
||||
docker exec $FORGEJO_MYSQL_CONTAINER \
|
||||
mysqldump --all-databases -u root -p$FORGEJO_MYSQL_ROOT_PASSWORD | gzip >"${BACKUP_DIRECTORY}$(date +%Y%m%d)".sql.gz
|
||||
docker exec ${FORGEJO_MYSQL_CONTAINER} mysqldump --all-databases -u root -p$FORGEJO_MYSQL_ROOT_PASSWORD | gzip >"${BACKUP_DIRECTORY}$(date +%Y%m%d)".sql.gz
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Send error and success notifications to Rocket Chat channels
|
||||
|
||||
# Env vars:
|
||||
# --- Webhook URLs for given channel, eg $RC_WEBHOOK_TEST
|
||||
# --- sourced from `.env` file in Zsh path
|
||||
|
||||
# Parameters:
|
||||
# --- $1 = Channel,
|
||||
# --- $2 = type 'error' | 'success'
|
||||
# --- $3 = Message
|
||||
|
||||
# Usage:
|
||||
# --- ./rocketchat_notifier.sh test 'success' 'Message goes here.'
|
||||
# --- ./rocketcaht_notifier.sh test 'error' 'Message goes here.'
|
||||
|
||||
declare -A CHANNEL_TO_WEBHOOK
|
||||
CHANNEL_TO_WEBHOOK["backups"]=$RC_WEBHOOK_BACKUPS
|
||||
|
||||
WEBHOOK=${CHANNEL_TO_WEBHOOK[$1]}
|
||||
|
||||
if [ "$2" != "error" ]; then
|
||||
curl -X POST \
|
||||
-H 'Content-type: application/json' \
|
||||
--data "{\"text\":\"INFO $3 \"}" \
|
||||
"$WEBHOOK" >/dev/null 2>&1
|
||||
else
|
||||
curl -X POST \
|
||||
-H 'Content-type: application/json' \
|
||||
--data "{\"text\":\"ERROR \", \"attachments\": [{\"color\": \"#FF0000\", \"text\": \"$3\"}]}" \
|
||||
"$WEBHOOK"
|
||||
fi
|
Loading…
Add table
Reference in a new issue