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 |
sorry, I don't use dkron anymore, so am not familiar with the newer versions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, how are you?
I have a problem importing my jobs on a new version of dkron.
I have the backup and this is ok, but when try to put on dkron v3 give me this error:
-- result --
parse error: Invalid numeric literal at line 1, column 10
Any idea?
Thx