Created
January 27, 2021 20:55
-
-
Save caio-vinicius/a3e74455abb069e3514fe4a0e8000e19 to your computer and use it in GitHub Desktop.
backup with mongodump script discord webhooks
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
url="https://discord.com/api/webhooks/#/#" | |
if mongodump mongodb+srv://-:[email protected]/ --db=-; then | |
curl -H "Content-Type: application/json" -X POST -d '{"content":"Database backup was successful!"}' $url | |
else | |
curl -H "Content-Type: application/json" -X POST -d '{"content":"@everyone Database backup failed."}' $url | |
fi | |
# crontab -e | |
# 0 */2 * * * path/backup.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment