Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually run backup rotation in [email protected] #55

Merged
merged 1 commit into from
Sep 14, 2024
Merged

Conversation

malor
Copy link
Member

@malor malor commented Sep 12, 2024

Dry run example:

# systemctl status [email protected][email protected] - Back up the PostgresSQL database `xsnippet-api`
     Loaded: loaded (/lib/systemd/system/[email protected]; static)
     Active: inactive (dead) since Fri 2024-09-13 03:00:04 UTC; 2h 13min ago
TriggeredBy: ● [email protected]
    Process: 2122016 ExecStartPre=/usr/bin/chown postgres:postgres /var/lib/postgresql-backups (code=exited, status=0/SUCCESS)
    Process: 2122017 ExecStart=/usr/bin/bash -c /usr/bin/pg_dump --compress=9 --no-owner --format=p --file=xsnippet-api_$(TZ=UTC date +%Y%m%d-%H%M%S).sql.gz xsnippet-api (c>
    Process: 2122018 ExecStartPost=/usr/bin/python3 /usr/local/bin/rotate.py --keep 30 --dir /var/lib/postgresql-backups (code=exited, status=0/SUCCESS)
   Main PID: 2122017 (code=exited, status=0/SUCCESS)
        CPU: 2.154s

Sep 13 03:00:01 xsnippet systemd[1]: Starting Back up the PostgresSQL database `xsnippet-api`...
Sep 13 03:00:02 xsnippet python3[2122018]: Dry run. No changes will be made.
Sep 13 03:00:02 xsnippet python3[2122018]: Used space: 30 files, 133682908 bytes
Sep 13 03:00:02 xsnippet python3[2122018]: Freed space: 34 files, 151342898 bytes
Sep 13 03:00:02 xsnippet systemd[1]: Started Back up the PostgresSQL database `xsnippet-api`.
Sep 13 03:00:04 xsnippet systemd[1]: [email protected]: Deactivated successfully.
Sep 13 03:00:04 xsnippet systemd[1]: [email protected]: Consumed 2.154s CPU time.

Dry run example:

```shell
Dry run. No changes will be made.

Used space: 30 files, 133682908 bytes
Freed space: 34 files, 151342898 bytes
```
@malor malor requested a review from ikalnytskyi September 12, 2024 20:12
@malor malor merged commit e14681a into master Sep 14, 2024
3 checks passed
@malor malor deleted the fix-backups branch September 14, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants