Skip to content

Instantly share code, notes, and snippets.

@alanorth
Created December 5, 2023 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanorth/1d9271148fb6ae436d9ed24019af6169 to your computer and use it in GitHub Desktop.
Save alanorth/1d9271148fb6ae436d9ed24019af6169 to your computer and use it in GitHub Desktop.
#!/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