Created
August 17, 2023 16:46
-
-
Save joeperpetua/8bfce702b73c574dc9cafa47f920bc76 to your computer and use it in GitHub Desktop.
Auto resume Hyper Backup task
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/sh | |
TASK_ID=3; | |
TASK_STATUS=$(synowebapi --exec api=SYNO.Backup.Task method=status version=1 task_id="$TASK_ID" additional='["last_bkp_result"]' | jq .data.last_bkp_result); | |
if [[ "$TASK_STATUS" == \"suspend\" ]]; then | |
echo "[$(date)] Backup is suspended" >> /volume1/hb_auto_resume.log; | |
echo "[$(date)] Resuming backup..." >> /volume1/hb_auto_resume.log; | |
synowebapi --exec api=SYNO.Backup.Task method=resume task_id="$TASK_ID" version=1 >> /volume1/hb_auto_resume.log; | |
else | |
echo "[$(date)] Backup is not suspended." >> /volume1/hb_auto_resume.log; | |
echo "[$(date)] Do nothing until next run..." >> /volume1/hb_auto_resume.log; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment