Created
December 5, 2023 18:28
-
-
Save alanorth/1d9271148fb6ae436d9ed24019af6169 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
#!/usr/bin/env bash | |
# run in batch CPU priority, with low-priority IO | |
rsync_command="chrt -b 0 ionice -c2 -n7 /usr/bin/rsync -av --delete" | |
rsync_output="start" | |
until [[ "$rsync_output" == "done" ]] | |
do | |
# notice the trailing slash on the rsync source argument | |
results_rsync=$($rsync_command /home/dspace/solr/ /home/backup/solr) | |
echo "completed solr sync iteration" | |
TEST=`echo "$results_rsync" | grep -o "data" | sed q` | |
if [[ "${TEST}" != "data" ]] | |
then | |
rsync_output="done" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment