citusdata / citusdata/pg_cron

Is it possible to schedule pg_dump using pg_cron?

Open
#338 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.9k
Forks
260
Avg merge
5d 5h
Merged PRs (30d)
1

Description

Hi,

Would it be possible to schedule pg_dump with a pg_cron schedule? I tried something like this:

``
SELECT cron.schedule(
'one_time_pg_dump', -- job name
'*/1 * * * *',
$$pg_dump -U myUser -d my_db -f /tmp/dump_$(date +%Y%m%d%H%M%S).sql$$
);

``

But the execution returns the message:

ERROR: syntax error at or near "pg_dump"
LINE 1: pg_dump -U myUser -d my_db -f /tmp/dump_$(date +%Y%m%...
^

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.