Hi,
may be the following script is useful for you:
#!/bin/bash
QUERY="SELECT VolumeName, InChanger, Slot, MediaType, VolStatus, VolBytes,
Pool.Name AS Pool, LastWritten, LastWritten + INTERVAL '1 s' *
Media.VolRetention AS Expires FROM Media JOIN Pool USING
(PoolId) LEFT JOIN Location ON (Media.LocationId=Location.LocationId)"
WHERE=""
if [ "$1" == "-o" ]; then
WHERE="WHERE InChanger=1"
fi
echo "=== Media by LastWritten ==="
ORDER="ORDER BY LastWritten"
echo -e "sqlquery\n$QUERY $WHERE $ORDER;\n" | bconsole
echo "=== Media by Expires ==="
ORDER="ORDER BY Expires"
echo -e "sqlquery\n$QUERY $WHERE $ORDER;\n" | bconsole
Regards
Stephan
On 03/19/2015 10:44 AM, - - wrote:
> Hi,
> Is there an easy for me to find out which volume has expired, with an
> SQL query? I could use bconsole (list media) to look as last written and
> compare with the VolRetention. But I am sure there is an easier way to
> achieve this.
> Will be grateful for any help
>
> ManyThanks
>
> krishan
>
> --
> You received this message because you are subscribed to the Google Groups
> "bareos-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout.
--
Stephan Dühr [email protected]
Bareos GmbH & Co. KG Phone: +49 221-630693-90
http://www.bareos.com
Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: S. Dühr, M. Außendorf,
J. Steffens, Philipp Storz, M. v. Wieringen
--
You received this message because you are subscribed to the Google Groups
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.