Skip to content

Commit

Permalink
MIG database_age_cron
Browse files Browse the repository at this point in the history
  • Loading branch information
Kev-Roche committed Jun 6, 2024
1 parent b3ce2e5 commit 3858fa1
Show file tree
Hide file tree
Showing 9 changed files with 539 additions and 0 deletions.
69 changes: 69 additions & 0 deletions database_age_cron/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
=================
Database Age Cron
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:13ab0febe972f77eb9af2cdb678d69c6648e34f3a8519c45acb04a816b4eb549
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fak--odoo--incubator-lightgray.png?logo=github
:target: https://github.com/akretion/ak-odoo-incubator/tree/16.0/database_age_cron
:alt: akretion/ak-odoo-incubator

|badge1| |badge2| |badge3|

This module adds a simple cron that allows to know easily what is the age of the database

You just have to check the `lastcall` date of the cron (via Odoo or via SQL)
to know when it ran for the last time.

**Table of contents**

.. contents::
:local:

Usage
=====

To make it work, you will need to deactivate the cron once the database is not in production anymore.

For instance with a script that runs:

.. code:: sql
UPDATE ir_cron SET active='f' WHERE cron_name = 'Database Age Cron';
Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/akretion/ak-odoo-incubator/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/akretion/ak-odoo-incubator/issues/new?body=module:%20database_age_cron%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Akretion

Maintainers
~~~~~~~~~~~

This module is part of the `akretion/ak-odoo-incubator <https://github.com/akretion/ak-odoo-incubator/tree/16.0/database_age_cron>`_ project on GitHub.

You are welcome to contribute.
Empty file added database_age_cron/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions database_age_cron/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Database Age Cron",
"summary": "Run a cron that determines database age",
"version": "16.0.1.0.0",
"category": "Uncategorized",
"website": "https://github.com/akretion/ak-odoo-incubator",
"author": " Akretion",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"base",
],
"data": [
"data/cron.xml",
],
}
16 changes: 16 additions & 0 deletions database_age_cron/data/cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>

<record id="database_age" model="ir.cron">
<field name="name">Database Age Cron</field>
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field name="priority">10</field>
<field name="active">True</field>
<field name="state">code</field>
<field name="model_id" ref="base.model_base" />
<field name="code">pass</field>
</record>

</odoo>
4 changes: 4 additions & 0 deletions database_age_cron/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module adds a simple cron that allows to know easily what is the age of the database

You just have to check the `lastcall` date of the cron (via Odoo or via SQL)
to know when it ran for the last time.
7 changes: 7 additions & 0 deletions database_age_cron/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
To make it work, you will need to deactivate the cron once the database is not in production anymore.

For instance with a script that runs:

.. code:: sql
UPDATE ir_cron SET active='f' WHERE cron_name = 'Database Age Cron';
Loading

0 comments on commit 3858fa1

Please sign in to comment.