Hello Kern,
Thank you for your clear explanation. I was thinking about an "ExpiresAt" field instead of an "ExpiresIn". The meaning of an ExpiresIn field is perfectly clear for me expressed in seconds. Also, I agree that the results from bconsole commands should be less human-readable since we have GUI interfaces for this purpose. IMHO these values should be in a kind of raw format that can make their use easier with/in other languages/frameworks.
Maybe the bellow PostgreSQL/MySQL queries (included in query.sql) could help with an "ExpiresAt" field:
21: List Media for a selected Pool
Choose a query (1-21): 21
Enter Pool name: File
+---------+------------+--------------+---------------------+---------------------+
| mediaid | volumename | volretention | lastwritten | expiresat |
+---------+------------+--------------+---------------------+---------------------+
| 1 | Vol-0001 | 31,536,000 | 2016-01-21 23:10:03 | 2017-01-20 23:10:04 |
+---------+------------+--------------+---------------------+---------------------+
For a PostgreSQL bacula database:
# 21
:List Media for a selected Pool
*Enter Pool name:
SELECT MediaId,VolumeName,Media.VolRetention,Media.LastWritten,to_timestamp(extract('epoch' from LastWritten)+Media.VolRetention+1) at time zone 'UTC' as ExpiresAt
FROM Media,Pool
WHERE Name='%1' AND Media.PoolId=Pool.PoolId;
For a MySQL bacula database:
# 21
:List Media for a selected Pool
*Enter Pool name:
SELECT MediaId,VolumeName,Media.VolRetention,Media.LastWritten,FROM_UNIXTIME(UNIX_TIMESTAMP(LastWritten)+Media.VolRetention+1) AS ExpiresAt
FROM Media,Pool
WHERE Name='%1' AND Media.PoolId=Pool.PoolId;
I'm not sure about adding one second to this value...
Am I misunderstanding something here?
Thank you.
Best regards,
Ana