it:postgresql:jobs
Различия
Показаны различия между двумя версиями страницы.
Следующая версия | Предыдущая версия | ||
it:postgresql:jobs [2022/11/22 12:27] – создано ura2404 | it:postgresql:jobs [2025/03/18 18:22] (текущий) – ura2404 | ||
---|---|---|---|
Строка 14: | Строка 14: | ||
</ | </ | ||
- | 2. Create a config file | + | 2. Setup directory for logging |
+ | <code bash> | ||
+ | mkdir / | ||
+ | chown -R postgres: | ||
+ | chmod g+w / | ||
+ | </ | ||
+ | |||
+ | 3. Create a config file | ||
+ | <code bash> | ||
+ | touch / | ||
+ | </ | ||
<file bash / | <file bash / | ||
DBNAME=postgres | DBNAME=postgres | ||
Строка 25: | Строка 35: | ||
</ | </ | ||
- | 3. Create | + | 4. Создать юнит файл |
- | <file bash / | + | |
+ | <code bash> | ||
+ | $ sudo systemctl edit --full --force pgagent.service | ||
+ | </code> | ||
+ | < | ||
[Unit] | [Unit] | ||
Description=PgAgent for PostgreSQL | Description=PgAgent for PostgreSQL | ||
Строка 60: | Строка 74: | ||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
- | </file> | + | </code> |
- | 4. Start Service | + | 5. Start Service |
<code bash> | <code bash> | ||
sudo -i | sudo -i | ||
Строка 71: | Строка 85: | ||
</ | </ | ||
- | 5. Enable auto rotation of logs | + | 6. Enable auto rotation of logs |
+ | <code bash> | ||
+ | touch / | ||
+ | </ | ||
<file bash / | <file bash / | ||
/ | / | ||
Строка 88: | Строка 105: | ||
</ | </ | ||
- | 6. В базе postgres | + | 7. В базе postgres |
<code sql> | <code sql> | ||
CREATE EXTENSION pgagent; | CREATE EXTENSION pgagent; | ||
Строка 106: | Строка 123: | ||
</ | </ | ||
- | 7. В целевой базе | + | 8. В целевой базе |
<code sql> | <code sql> | ||
- | CREATE USER " | + | GRANT USAGE ON SCHEMA <schema_name> TO pgagent; |
- | LOGIN | + | GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA <schema_name> TO pgagent; |
- | NOSUPERUSER | + | GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA <schema_name> TO pgagent; |
- | INHERIT | + | |
- | NOCREATEDB | + | |
- | NOCREATEROLE | + | |
- | NOREPLICATION | + | |
- | encrypted password ' | + | |
- | + | ||
- | GRANT USAGE ON SCHEMA <db_name> TO pgagent; | + | |
- | GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA <db_name> TO pgagent; | + | |
- | GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA <db_name> TO pgagent; | + | |
</ | </ | ||
- | |||
- | |||
it/postgresql/jobs.1669120032.txt.gz · Последнее изменение: 2022/11/22 12:27 — ura2404