{ "info": { "author": "Jochem Berends", "author_email": "jochem.berends@ke-works.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Duplicity Backup to S3\n\n[![image](https://img.shields.io/pypi/v/duplicity_backupp.svg)](https://pypi.python.org/pypi/duplicity_backup)\n\n[![image](https://img.shields.io/travis/jberends/duplicity_backup.svg)](https://travis-ci.org/jberends/duplicity_backup)\n\n[![image](https://pyup.io/repos/github/jberends/duplicity_backup/shield.svg)](https://pyup.io/repos/github/jberends/duplicity_backup)\n\nDuplicity backup to S3 for production servers using simple toml file.\n\n## License\n\nFree software: Apache Software License 2.0\n\n## Features\n\nThis is a duplicity command line backup wrapper that will backup to S3 that is using a validated yaml configuration file using modern and awesome CLI patterns. The commands `incremental`, `list files`, `status`, `verify`, `cleanup`, and `remove` are implemented.\n\nThe primary use case to build this (yet another one) CLI wrapper for duplicity to be able to deploy the command in production and inject it into a `cron.daily` and having a hands-off automated backup of production servers. We use it a KE-works to automate our production server backups.\n\n## Dependencies\n\n- `duplicity`\n- `python-boto` to connect to S3\n\n## Installation\n\nYou can either install this as a system command on any operating system supporting Python 3.5 or later.\n\nTo install as global command from PyPI:\n\n```bash\npython3 -m pip install duplicity-backup-s3\n```\n\nTo install for your user only from PyPI\n\n```bash\npython3 -m pip install --user duplicity-backup-s3\n```\n\nTo install from the git repository (latest master branch):\n\n```bash\npython3 -m pip install git+https://github.com/jberends/duplicity_backup.git#wheel=duplicity_backup_s3\n```\n\n### First use\n\nTo first use, you need to create a configuration yaml file. You can use the helper command `init` for that. Use the built-in help function for your enjoyment.\n\n```bash\n# help is neigh\nduplicity_backup_s3 --help\n\n# and to init the configuration YAML file\nduplicity_backup_s3 init\n```\n\nIt will drop you a `duplcitiy_backyp_s3.yaml` in your current directory. That will look like this:\n\n```yaml\naws:\n AWS_ACCESS_KEY_ID: foobar_aws_key_id # your amazon S3 user that has write right to a backup bucket\n AWS_SECRET_ACCESS_KEY: foobar_aws_access_key # your amazon S3 user secret\nbackuproot: /home # the backup 'root' path. Everything underneath is considered for backup.\nexcludes:\n - \"**\" # a list of exclude paths. May be '**' to exclude everything except what you include\nincludes:\n - /home/Pictures # a list of includes, which are full paths\n - /home/Music\nremote:\n bucket: '' # S3 bucket name\n path: '__test' # subpath within the bucket\nfull_if_older_than: 7D # default is incremental, will create full backup every 7Days.\n```\n\nYou can alter the configuration file to your liking. The command will check the configuration for its validity and tell you what went wrong and what you need to correct. If you made mistakes, it can be beneficial to checkout the duplicity man page for more information on that topic. However we tried to be as verbose as possible to guide you in the right direction.\n\n### First backup\n\nTo call your first backup, which is a full one.\n\n```bash\nduplicity_backup_s3 incr --verbose\n\n# or if the config is somewhere else\nduplicity_backup_s3 incr --config /path/to/configuation.yaml\n```\n\nThat might take time according to the size of the backup.\nYou can see the volumes being uploaded to the [S3 bucket](https://s3.console.aws.amazon.com/s3/home).\n\nTo check the backup collection, list and verify the backup you may use:\n\n```bash\n# collection status\nduplicity_backup_s3 status\n\n# list all files\nduplicity_backup_s3 list\n\n# verify backup\nduplicity_backup_s3 verify\n```\n\n### Remove old backups\n\nTo remove older backups duplicity provides some commands. We implemented those in the `remove` command. \n\n```bash\n# to remove backups older than 7D\nduplicity_backup_s3 remove --older-than 7D\n\n# to remove older backup except the last 4 full backups\nduplicity_backup_s3 remove --all-but-n-full 4\n```\n\n### Using this as daily backup in a cronjob\n\nTo use this in a daily cron job, you can alter the `crontab` for the user `root`\n\n```bash\ncrontab -u root -e\n```\n\nYou can alter the crontab in the following way\n\n```text\n# Daily backup and remove older backup\n7 4 * * * /bin/duplicity_backup_s3 incr --config=/path/to/conf.yaml && /bin/duplicity_backup_s3 remove --older-than 7D --config=/path/to/conf.yaml\n# | | | | +- the command to execute\n# | | | +--- day of the week (0-6) Sunday=0 (*=every day)\n# | | +----- month of the year (*=every month)\n# | +------- day of the month (*=every day)\n# +--------- hour of the day\n#----------- minute in the hour\n```\n\n## TODO\n\n- [ ] implement appdirs for default configuration file placement\n- [ ] implement restore for restoring\n- [ ] test on digitalocean\n- [ ] If requested migrate `--s3-european-buckets` to configuration file\n- [ ] If requested implement GPG/Encryption capabilities. Possibly reusing code of `kecpkg-tools` to manage certificates.\n- [ ] Initialise itself into `cron.daily`\n\n## Credits\n\n- This package was inspired by the great work done by the duplicity team, back in the days.\n- This package was inspired by the great amount of perl/bash code by the [duplicity_backup.sh](https://github.com/zertrin/duplicity-backup.sh) project.\n- This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.\n\\n\\n# Changelog\n\n## v0.5.0 (5JUN19)\n\nFirst initial public release\n* commands `incr`, `list`, `status`, `verify`, `cleanup` implemented.\n* added yaml schema check for the configuration file.\n\n## v0.2.0 (3JUN19) \n\ninternal release\n\n* migrated to command structure. Now offers `incr` and `init`\n\n## v0.1.0 (3JUN19)\n\ninternal release\n\n* First release on PyPI.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://git.ke-works.net/kew/duplicity_backup.git", "keywords": "duplicity_backup_s3", "license": "Apache Software License 2.0", "maintainer": "", "maintainer_email": "", "name": "duplicity-backup-s3", "package_url": "https://pypi.org/project/duplicity-backup-s3/", "platform": "", "project_url": "https://pypi.org/project/duplicity-backup-s3/", "project_urls": { "Homepage": "https://git.ke-works.net/kew/duplicity_backup.git" }, "release_url": "https://pypi.org/project/duplicity-backup-s3/0.5.0/", "requires_dist": [ "Click (>=6.0)", "PyYAML", "envparse", "cerberus" ], "requires_python": ">=3.5", "summary": "Duplicity backup to S3 for production servers using simple toml file.", "version": "0.5.0" }, "last_serial": 5359438, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "6b84130d9893e167cf21ded5b379886c", "sha256": "30969b4beaf8e2b1d7c615714858793df5fdefaf784099c0420e3d23c459c22a" }, "downloads": -1, "filename": "duplicity_backup_s3-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6b84130d9893e167cf21ded5b379886c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 16794, "upload_time": "2019-06-04T20:06:06", "url": "https://files.pythonhosted.org/packages/b6/44/32cab37185bf178f978556ca3b37aad47c71d1af11976dbc2301006dac0b/duplicity_backup_s3-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a2756613b3d390beb0d31ab389ace60", "sha256": "175b62f32c097c6ed6b8f787d31cdb6933c3a71e1ac34a1475b5e017da31e1b3" }, "downloads": -1, "filename": "duplicity_backup_s3-0.5.0.tar.gz", "has_sig": false, "md5_digest": "7a2756613b3d390beb0d31ab389ace60", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 15007, "upload_time": "2019-06-04T20:06:11", "url": "https://files.pythonhosted.org/packages/78/0a/1490a68bd3d2bd69ea4a864abf8ad6e6c96f0d1d4ff5a9424630b4f6e050/duplicity_backup_s3-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6b84130d9893e167cf21ded5b379886c", "sha256": "30969b4beaf8e2b1d7c615714858793df5fdefaf784099c0420e3d23c459c22a" }, "downloads": -1, "filename": "duplicity_backup_s3-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6b84130d9893e167cf21ded5b379886c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5", "size": 16794, "upload_time": "2019-06-04T20:06:06", "url": "https://files.pythonhosted.org/packages/b6/44/32cab37185bf178f978556ca3b37aad47c71d1af11976dbc2301006dac0b/duplicity_backup_s3-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a2756613b3d390beb0d31ab389ace60", "sha256": "175b62f32c097c6ed6b8f787d31cdb6933c3a71e1ac34a1475b5e017da31e1b3" }, "downloads": -1, "filename": "duplicity_backup_s3-0.5.0.tar.gz", "has_sig": false, "md5_digest": "7a2756613b3d390beb0d31ab389ace60", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 15007, "upload_time": "2019-06-04T20:06:11", "url": "https://files.pythonhosted.org/packages/78/0a/1490a68bd3d2bd69ea4a864abf8ad6e6c96f0d1d4ff5a9424630b4f6e050/duplicity_backup_s3-0.5.0.tar.gz" } ] }