Last active
April 11, 2024 01:53
-
-
Save luckylittle/80f343221636bdb68fc8cc2e274752c6 to your computer and use it in GitHub Desktop.
Bash script to backup the main settings & filters from autobrr (until proper db backup exists)
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
#!/bin/zsh | |
export AUTOBRR_HOST="127.0.0.1" | |
export AUTOBRR_API_KEY="abcdefghijklmnopqrstuvwxyz" | |
# Backup indexers | |
curl -X GET "http://${AUTOBRR_HOST}:7474/api/indexer" -H "X-API-Token: ${AUTOBRR_API_KEY}" | jq > autobrr_indexers$(date +%Y%m%d).json | |
# Backup IRCs | |
curl -X GET "http://${AUTOBRR_HOST}:7474/api/irc" -H "X-API-Token: ${AUTOBRR_API_KEY}" | jq > autobrr_ircs$(date +%Y%m%d).json | |
# Backup RSS Feeds | |
curl -X GET "http://${AUTOBRR_HOST}:7474/api/feeds" -H "X-API-Token: ${AUTOBRR_API_KEY}" | jq > autobrr_feeds$(date +%Y%m%d).json | |
# Backup filters | |
ids=$(curl -X GET "http://${AUTOBRR_HOST}:7474/api/filters" -H "X-API-Token: ${AUTOBRR_API_KEY}" | jq -r '.[].id') | |
while read -r id; do | |
name=$(curl -X GET "http://${AUTOBRR_HOST}:7474/api/filters/${id}" -H "X-API-Token: ${AUTOBRR_API_KEY}" | jq -r '.name') | |
curl -X GET "http://${AUTOBRR_HOST}:7474/api/filters/${id}" -H "X-API-Token: ${AUTOBRR_API_KEY}" | jq > autobrr_filter_${name}$(date +%Y%m%d).json | |
done <<< "$ids" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example - To add except_release_groups to all filters: