22 lines
369 B
Bash
Executable File

#!/bin/bash
case $1 in
log)
STATUS=$(tail -n 2 /var/log/backup.log | head -n 1 | grep $(date +%Y-%m-%d) | cut -f 3 -d " ")
if [[ $STATUS == "SUCCESS_BACKUP" ]]
then echo "1";
else echo "0";
fi
;;
state)
test -f /var/tmp/backuper.state
if [[ $? == "0" ]]
then
cat /var/tmp/backuper.state
else
echo "none"
fi
;;
esac