xxxxxxxxxx
// Install PgAgent
sudo apt-get update
sudo apt-get install pgagent
// PG database setup
// Run in PG
CREATE EXTENSION pgagent;
/*
This command will create a number of tables and other objects in a schema called ‘pgagent’.
The database must also have the pl/pgsql procedural language installed.
*/
// add pl/pgsql extention
// Run in PG
CREATE LANGUAGE plpgsql;
// Run and test PgAgent
sudo su - postgres
// start the service
/usr/bin/pgagent dbname=postgres user=postgres
// Start the service and enable at boot
sudo systemctl daemon-reload
sudo systemctl start pgagent.service
sudo systemctl enable pgagent.service