This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
kittehcluster/upload.sh
2024-07-13 20:01:15 -04:00

19 lines
No EOL
550 B
Bash
Executable file

#!/usr/bin/env bash
KITTEH_NODE_1=192.168.0.20
KITTEH_NODE_2=192.168.0.21
while IFS= read -r LINE; do
UPLOAD_PATH="/var/lib/vz/dump/$(basename $LINE)"
echo "Uploading file '$LINE'..."
if [ "$(dirname $LINE)" = "out/kitteh-node-1" ]; then
rsync --info=progress2 $LINE root@$KITTEH_NODE_1:$UPLOAD_PATH
else
rsync --info=progress2 $LINE root@$KITTEH_NODE_2:$UPLOAD_PATH
fi
ESCAPED_LINE=$(printf '%s\n' "$LINE" | sed -e 's/[\/&]/\\&/g')
sed -i "/$ESCAPED_LINE/d" meta/tagged_for_upload
done < meta/tagged_for_upload
echo "Done."