Journal "Software Engineering"
a journal on theoretical and applied science and technology
ISSN 2220-3397
Issue N2 2020 year
The basics of the organization and operation of the background program PdbCron, designed to perform periodic scheduled data processing in the PostgreSQL DBMS (cleaning temporary or outdated data, checking the correctness or backup data) on its own schedule in automatic mode in the operating environment of Linux are considered. The approach is entirely founded on free distributed Postgres software (including libpq function library and utility pgdump). Likewise a well-known program Cron the program PdbCron is a permanently active "daemon" in Linux environment, but is entirely focused on databases processing instead of tasks scheduling in the system. Unlike the Cron, the program uses different formats of schedule items based not only on the month format (year — month — day — hour — minute), but on the week format (year — week — day — hour — minute) or short year format (year— day of year — hour — minute). The number of a week in the year is determined according to ISO 8601 standard. Every schedule item can be associated with an arbitrary list of processing steps applied to arbitrary subset of databases on a Postgres server (including an SQL-statement execution, a stored function call or dump generation). The structure of PdbCron and the functions of its main components are described. Although the program was intended for use in a very specific project, its authors tried to develop it so that the features of this project in no way affect its properties and capabilities. Maximum versatility and the capability of reuse were considered among the main priorities.