Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F5493748
bvfs_cleanup.rake
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Sep 30, 9:30 AM
Size
579 B
Mime Type
text/plain
Expires
Fri, Oct 2, 9:30 AM (7 h, 36 m)
Engine
blob
Format
Raw Data
Handle
458551
Attached To
rARCHIVING archiving
bvfs_cleanup.rake
View Options
namespace
:bvfs
do
desc
'Cleans up the restore database'
task
cleanup
:
:environment
do
for_purge
=
ActiveRecord
::
Base
.
establish_connection
(
BACULA_CONF
)
.
connection
.
tables
.
select
do
|
name
|
match_data
=
name
.
match
(
/^b2\d+(\d{12}$)/
)
match_data
.
present?
&&
match_data
[
1
].
present?
&&
match_data
[
1
]
<
(
Archiving
.
settings
[
:temp_db_retention
].
ago
.
to_f
*
100
)
.
to_i
.
to_s
end
for_purge
.
each
do
|
dbname
|
Bvfs
.
new
(
nil
,
[]
)
.
purge_db
(
dbname
)
end
Rails
.
logger
.
warn
(
"[BVFS]: Cleaned up dbs:
#{
for_purge
.
join
(
', '
)
}
"
)
end
end
Event Timeline
Log In to Comment