#!/bin/bash

set -xe

# Script that obtains lost_books report info from testing.
# Author: Mikhail Veltishchev <mvel@yandex-team.ru>

date="`date +%Y.%m.%d`"
#prodHost="lib01e.tools.yandex.net"
testHost="lib.test.tools.yandex-team.ru"
#prodDump="/tmp/libra-production-$date.sql"
ssh="ssh -T"

$ssh $testHost << EOF
    cd /usr/lib/yandex/yandex-tools-libra/libra/
    ./manage.py lost_books $HOME/lost_books-$date.csv
EOF
scp $testHost:$HOME/lost_books-$date.csv .
