Last active
October 7, 2023 18:41
-
-
Save pjz/94f4bd81a0897fd64db44593078e2156 to your computer and use it in GitHub Desktop.
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/bash | |
# based on https://github.com/victorcoder/dkron/issues/212 | |
#dkron_url="http://localhost:8080" | |
dkron_url=$1 | |
if [ -z "$dkron_url" ]; then | |
echo "Usage: $0 <dkron base url>" | |
exit 1 | |
fi | |
curl -s -X GET "$dkron_url/v1/jobs" -H "accept: application/json" -o - | |
echo |
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/bash | |
# based on https://github.com/victorcoder/dkron/issues/212 | |
dkron_url=$1 | |
dkron_backup=$2 | |
if [ -z "$dkron_url" -o -z "$dkron_backup" ]; then | |
echo "Usage: $0 <dkron base url> <dkron backup filename>" | |
exit 1 | |
fi | |
LENGTH=$(jq length $dkron_backup) | |
for (( i=0; i<$LENGTH; i++ )) | |
do | |
echo "=== JOB $i ===" | |
jq ".[$i]" $dkron_backup | |
echo "-- result --" | |
jq ".[$i]" $dkron_backup | curl -sX POST "$dkron_url/v1/jobs" -H "accept: application/json" -H "Content-Type: application/json" -d @- | jq . | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sorry, I don't use dkron anymore, so am not familiar with the newer versions.