collective.backup 1.0.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- collective_backup-1.0.0a1/CHANGES.rst +35 -0
- collective_backup-1.0.0a1/CONTRIBUTORS.rst +40 -0
- collective_backup-1.0.0a1/Dockerfile +67 -0
- collective_backup-1.0.0a1/HISTORY.rst +783 -0
- collective_backup-1.0.0a1/LICENSE +339 -0
- collective_backup-1.0.0a1/MANIFEST.in +6 -0
- collective_backup-1.0.0a1/PKG-INFO +773 -0
- collective_backup-1.0.0a1/README.rst +701 -0
- collective_backup-1.0.0a1/docker-entrypoint.sh +18 -0
- collective_backup-1.0.0a1/pyproject.toml +228 -0
- collective_backup-1.0.0a1/setup.cfg +4 -0
- collective_backup-1.0.0a1/setup.py +8 -0
- collective_backup-1.0.0a1/src/collective/backup/__init__.py +1 -0
- collective_backup-1.0.0a1/src/collective/backup/__main__.py +5 -0
- collective_backup-1.0.0a1/src/collective/backup/cli.py +115 -0
- collective_backup-1.0.0a1/src/collective/backup/config.py +5 -0
- collective_backup-1.0.0a1/src/collective/backup/copyblobs.py +1643 -0
- collective_backup-1.0.0a1/src/collective/backup/main.py +359 -0
- collective_backup-1.0.0a1/src/collective/backup/repozorunner.py +393 -0
- collective_backup-1.0.0a1/src/collective/backup/scripts.py +757 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/__init__.py +1 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/altrestore.rst +291 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/backup_blobs_archive.rst +273 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/backup_blobs_dir.rst +240 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/backup_blobs_dir_hard_links.rst +256 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/base.rst +158 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/blob_timestamps.rst +361 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/blobs.rst +619 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/cleanup_archives.rst +186 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/cleanup_dir.rst +147 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/incremental_blobs.rst +192 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/location.rst +67 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/no_rsync.rst +150 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/options.rst +142 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/prefix.rst +316 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/test_docs.py +196 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/test_unit.py +827 -0
- collective_backup-1.0.0a1/src/collective/backup/tests/zipbackup.rst +132 -0
- collective_backup-1.0.0a1/src/collective/backup/utils.py +235 -0
- collective_backup-1.0.0a1/src/collective.backup.egg-info/PKG-INFO +773 -0
- collective_backup-1.0.0a1/src/collective.backup.egg-info/SOURCES.txt +43 -0
- collective_backup-1.0.0a1/src/collective.backup.egg-info/dependency_links.txt +1 -0
- collective_backup-1.0.0a1/src/collective.backup.egg-info/entry_points.txt +2 -0
- collective_backup-1.0.0a1/src/collective.backup.egg-info/requires.txt +7 -0
- collective_backup-1.0.0a1/src/collective.backup.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.. NOTE: You should *NOT* be adding new change log entries to this file, this
|
|
2
|
+
file is managed by towncrier. You *may* edit previous change logs to
|
|
3
|
+
fix problems like typo corrections or such.
|
|
4
|
+
|
|
5
|
+
To add a new change log entry, please see the notes from the ``pip`` project at
|
|
6
|
+
https://pip.pypa.io/en/latest/development/#adding-a-news-entry
|
|
7
|
+
|
|
8
|
+
.. towncrier release notes start
|
|
9
|
+
|
|
10
|
+
1.0.0a1 (2026-10-09)
|
|
11
|
+
--------------------
|
|
12
|
+
|
|
13
|
+
- Initial release. Backup and restore a ZODB filestorage and blobstorage
|
|
14
|
+
with ``repozo``, with sensible defaults. Commands: ``backup``,
|
|
15
|
+
``snapshotbackup``, ``zipbackup``, ``restore``, ``snapshotrestore``,
|
|
16
|
+
``ziprestore`` and ``altrestore``.
|
|
17
|
+
[jladage]
|
|
18
|
+
|
|
19
|
+
- Run the commands with ``collective-backup <command>``, or generate scripts like
|
|
20
|
+
``bin/backup`` and ``bin/restore`` with ``collective-backup generate``.
|
|
21
|
+
``collective-backup show`` shows the computed options.
|
|
22
|
+
[jladage]
|
|
23
|
+
|
|
24
|
+
- Configure it in the ``[tool.collective-backup]`` table of ``pyproject.toml``,
|
|
25
|
+
with ``COLLECTIVE_BACKUP_*`` variables in a ``.env`` file, or with environment
|
|
26
|
+
variables.
|
|
27
|
+
[jladage]
|
|
28
|
+
|
|
29
|
+
- Schedule backups with the ``cron`` and ``snapshot_cron`` options:
|
|
30
|
+
``collective-backup crontab`` prints a crontab for them.
|
|
31
|
+
[jladage]
|
|
32
|
+
|
|
33
|
+
- Add a ``Dockerfile`` for an image that runs the scheduled backups,
|
|
34
|
+
for use next to the ``plone/plone-backend`` and ``plone/plone-zeo`` images.
|
|
35
|
+
[jladage]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
collective.recipe.backup is basically a port of ye olde instancemanager_'s
|
|
2
|
+
backup functionality. That backup functionality was coded mostly by Reinout
|
|
3
|
+
van Rees and Maurits van Rees, both from `Zest software`_
|
|
4
|
+
|
|
5
|
+
Creating the buildout recipe was done by Reinout_ with some fixes by Maurits_, who is now the main developer and maintainer.
|
|
6
|
+
|
|
7
|
+
The snapshotrestore script was added by Nejc Zupan (niteoweb_).
|
|
8
|
+
|
|
9
|
+
The fullbackup script was added by `Tom 'Spanky' Kapanka`_.
|
|
10
|
+
|
|
11
|
+
Archive blob backups feature added by `Matej Cotman`_ (niteoweb_).
|
|
12
|
+
|
|
13
|
+
The standalone ``collective.backup`` version, configured with environment variables,
|
|
14
|
+
was made by Jean-Paul Ladage (`Zest software`_).
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Sponsorship
|
|
18
|
+
-----------
|
|
19
|
+
|
|
20
|
+
Work on collective.recipe.backup has been made possible by Ghent University, or UGent.
|
|
21
|
+
See https://www.ugent.be.
|
|
22
|
+
Ghent University is a top 100 university and one of the major universities in Belgium.
|
|
23
|
+
|
|
24
|
+
.. Links used above.
|
|
25
|
+
|
|
26
|
+
.. _Zest software: http://zestsoftware.nl/
|
|
27
|
+
|
|
28
|
+
.. _Reinout: http://reinout.vanrees.org/
|
|
29
|
+
|
|
30
|
+
.. _Maurits: http://maurits.vanrees.org/
|
|
31
|
+
|
|
32
|
+
.. _instancemanager: https://pypi.python.org/pypi/instancemanager
|
|
33
|
+
|
|
34
|
+
.. _`Tom 'Spanky' Kapanka`: https://github.com/spanktar
|
|
35
|
+
|
|
36
|
+
.. _`Sylvain Bouchard`: https://github.com/bouchardsyl
|
|
37
|
+
|
|
38
|
+
.. _`Matej Cotman`: https://github.com/matejc
|
|
39
|
+
|
|
40
|
+
.. _niteoweb: http://www.niteoweb.com
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1
|
|
2
|
+
# Image that makes scheduled backups of a Plone filestorage and blobstorage.
|
|
3
|
+
# Configure it with COLLECTIVE_BACKUP_* environment variables, see README.rst.
|
|
4
|
+
ARG PYTHON_VERSION=3.12
|
|
5
|
+
|
|
6
|
+
FROM python:${PYTHON_VERSION}-slim AS builder
|
|
7
|
+
ARG TARGETARCH
|
|
8
|
+
ARG SUPERCRONIC_VERSION=v0.2.49
|
|
9
|
+
ARG SUPERCRONIC_SHA1SUM_amd64=e63c11a9726b775a6a11801e81af4f3fb926aa68
|
|
10
|
+
ARG SUPERCRONIC_SHA1SUM_arm64=0b6c5bb743e0b0dafed1132198c81807927ac413
|
|
11
|
+
|
|
12
|
+
COPY . /src
|
|
13
|
+
# Install with the pip of the builder, so the venv has no pip or setuptools.
|
|
14
|
+
# Drop the tests and C sources that the ZODB packages ship.
|
|
15
|
+
RUN set -eux; \
|
|
16
|
+
python -m venv --without-pip /app; \
|
|
17
|
+
pip --python /app/bin/python install --no-cache-dir /src; \
|
|
18
|
+
find /app/lib -depth \
|
|
19
|
+
\( -type d -name tests -o -name '*.c' -o -name '*.h' \) \
|
|
20
|
+
-exec rm -rf {} +
|
|
21
|
+
|
|
22
|
+
# Download supercronic here, so the image needs no curl or ca-certificates.
|
|
23
|
+
ADD https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-${TARGETARCH} /supercronic
|
|
24
|
+
RUN set -eux; \
|
|
25
|
+
case "${TARGETARCH}" in \
|
|
26
|
+
amd64) sha1="${SUPERCRONIC_SHA1SUM_amd64}" ;; \
|
|
27
|
+
arm64) sha1="${SUPERCRONIC_SHA1SUM_arm64}" ;; \
|
|
28
|
+
*) echo "Unsupported architecture ${TARGETARCH}"; exit 1 ;; \
|
|
29
|
+
esac; \
|
|
30
|
+
echo "${sha1} /supercronic" | sha1sum -c -; \
|
|
31
|
+
chmod +x /supercronic
|
|
32
|
+
|
|
33
|
+
FROM python:${PYTHON_VERSION}-slim
|
|
34
|
+
|
|
35
|
+
LABEL org.opencontainers.image.title="collective-backup" \
|
|
36
|
+
org.opencontainers.image.description="Scheduled backups of a Plone filestorage and blobstorage with repozo" \
|
|
37
|
+
org.opencontainers.image.source="https://github.com/collective/collective.backup" \
|
|
38
|
+
org.opencontainers.image.licenses="GPL-2.0-only"
|
|
39
|
+
|
|
40
|
+
# The plone user has the same uid and gid as in the plone/plone-backend
|
|
41
|
+
# image, so we can read and restore its files.
|
|
42
|
+
RUN set -eux; \
|
|
43
|
+
apt-get update; \
|
|
44
|
+
apt-get install -y --no-install-recommends rsync; \
|
|
45
|
+
rm -rf /var/lib/apt/lists/*; \
|
|
46
|
+
groupadd --system --gid 500 plone; \
|
|
47
|
+
useradd --system --uid 500 --gid plone --home-dir /app --no-create-home plone; \
|
|
48
|
+
mkdir -p /data /backups; \
|
|
49
|
+
chown plone:plone /data /backups
|
|
50
|
+
|
|
51
|
+
COPY --from=builder /supercronic /usr/local/bin/supercronic
|
|
52
|
+
COPY --from=builder /app /app
|
|
53
|
+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
54
|
+
|
|
55
|
+
# The plone/plone-backend image keeps its data in /data.
|
|
56
|
+
# Backups go to /backups, which you should mount as a separate volume.
|
|
57
|
+
ENV PATH="/app/bin:${PATH}" \
|
|
58
|
+
PYTHONUNBUFFERED=1 \
|
|
59
|
+
COLLECTIVE_BACKUP_VAR_DIR=/data \
|
|
60
|
+
COLLECTIVE_BACKUP_LOCATIONPREFIX=/backups \
|
|
61
|
+
COLLECTIVE_BACKUP_CRON="0 3 * * *"
|
|
62
|
+
|
|
63
|
+
USER plone
|
|
64
|
+
WORKDIR /app
|
|
65
|
+
VOLUME ["/backups"]
|
|
66
|
+
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
67
|
+
CMD ["cron"]
|