Skip to content

Commit

Permalink
Create telraam_dump_to_client2.sh
Browse files Browse the repository at this point in the history
File found on client1, for preservation purposes. Is used to backup the telraam db to client2
  • Loading branch information
mcbloch authored Apr 18, 2024
1 parent 29daae2 commit 46d1f81
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions telraam_dump_to_client2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

echo "Enter client 2 IP: "
read client2_ip

while true; do
filename="/tmp/__telraam_dump_$(date +%FT%T).sql.gz"

echo "Dumping telraam..."
sudo -u postgres pg_dump -d telraam --inserts --rows-per-insert=2000 -Ft | gzip > "${filename}"

echo "Copying dump to client 2 (${filename})..."
scp "${filename}" "zeus@${client2_ip}:/home/zeus/telraam_dumps"

echo "Removing local dump..."
sudo rm -f "${filename}"

echo "Done"
echo ""
sleep 300
done

0 comments on commit 46d1f81

Please sign in to comment.