dbkp


Namedbkp JSON
Version 1.0.5 PyPI version JSON
download
home_pagehttps://github.com/acristoffers/dbkp
SummaryDotfiles backup and restore tool
upload_time2024-01-16 08:01:27
maintainer
docs_urlNone
authorÁlan Crístoffer
requires_python>=3.7
licenseMIT
keywords dotfiles backup restore manager
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # dbkp - dotfiles backup

dbkp simply backups and restores dotfiles using `rsync -La`. You can use it with
any version control or backup strategy you want.

## Instalation

Install with pip:

`pip3 install dbkp`

## Usage

Put the file dbkp.json on a folder and configure it as you want. Then either run
`dbkp backup` from the folder or pass the path to the configuration file as
`dbkp backup /path/to/dbkp.json`. A folder named dotfiles in the same folder as
the configuration file will be created and all dotfiles will be synced inside
it. Use `dbkp restore` in the same way to rsync the files from the dotfiles
folder into their places.

## Configuration example

The configuration is a list of files to backup, or objects that adds some
features to the specific dotfile.

A string will backup the folder/file. This will backup the file `~/.vimrc`:

```json
["~/.vimrc"]
```

It is the same as

```json
[
  {
    "path": "~/.vimrc",
    "alias": "vimrc"
  }
]
```

`alias` is the name the file/folder will have inside the dotfiles folder. By
default it is the name of the file/folder without a leading dot.

It is also possible to exclude subfiles/subfolders from a folder. The complete
folder will be synced and then the files/folders will be deleted. You can
specify both `only` and `exclude`, but `exclude` will be ignored in this case.
`only` will remove all files but the ones listed and `exclude` will only exclude
the ones listed.

```json
[
  {
    "path": "~/.config/fish",
    "only": ["functions"],
    "exclude": ["completions"]
  }
]
```

The `links` options allows to create symlinks after restoring. It is a list of
either strings or lists of 2 string elements. If the element is a string, then a
symlink will be created pointing to `path`. If it a list of 2 strings, the
second is the symlink and will point to `path`/`first element`. In the example,
`~/.vimrc` will point to `~/.config/nvim/init.nvim` and `~/neovim` will point to
`~/.config/nvim`.

```json
[
  {
    "path": "~/.config/nvim",
    "links": ["~/neovim", ["init.vim", "~/.vimrc"]]
  }
]
```

It is also possible to run commands to do the backup/restore.

```json
[
  {
    "backup": "brew leaves",
    "restore": "xargs brew install",
    "alias": "brew.leaves"
  }
]
```

This is the same as backing up with

```sh
brew leaves > brew.leaves
```

and then restoring with

```sh
cat brew.leaves | xargs brew install
```

The current working directory is changed to the folder containing the
configuration file before executing anything, so if you want to specify files in
the command line, remember that: you need to quote file paths if they contain
spaces and your `alias` file is in `dotfiles/:alias"`.

## LICENSE

The MIT License (MIT)

Copyright (c) 2021 Álan Crístoffer e Sousa

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/acristoffers/dbkp",
    "name": "dbkp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "dotfiles,backup,restore,manager",
    "author": "\u00c1lan Cr\u00edstoffer",
    "author_email": "acristoffers@startmail.com",
    "download_url": "https://files.pythonhosted.org/packages/98/a5/99f4970ac56ef5573c4ac50401cecd3347425a84c682bf7ea33312666ea0/dbkp-1.0.5.tar.gz",
    "platform": null,
    "description": "# dbkp - dotfiles backup\n\ndbkp simply backups and restores dotfiles using `rsync -La`. You can use it with\nany version control or backup strategy you want.\n\n## Instalation\n\nInstall with pip:\n\n`pip3 install dbkp`\n\n## Usage\n\nPut the file dbkp.json on a folder and configure it as you want. Then either run\n`dbkp backup` from the folder or pass the path to the configuration file as\n`dbkp backup /path/to/dbkp.json`. A folder named dotfiles in the same folder as\nthe configuration file will be created and all dotfiles will be synced inside\nit. Use `dbkp restore` in the same way to rsync the files from the dotfiles\nfolder into their places.\n\n## Configuration example\n\nThe configuration is a list of files to backup, or objects that adds some\nfeatures to the specific dotfile.\n\nA string will backup the folder/file. This will backup the file `~/.vimrc`:\n\n```json\n[\"~/.vimrc\"]\n```\n\nIt is the same as\n\n```json\n[\n  {\n    \"path\": \"~/.vimrc\",\n    \"alias\": \"vimrc\"\n  }\n]\n```\n\n`alias` is the name the file/folder will have inside the dotfiles folder. By\ndefault it is the name of the file/folder without a leading dot.\n\nIt is also possible to exclude subfiles/subfolders from a folder. The complete\nfolder will be synced and then the files/folders will be deleted. You can\nspecify both `only` and `exclude`, but `exclude` will be ignored in this case.\n`only` will remove all files but the ones listed and `exclude` will only exclude\nthe ones listed.\n\n```json\n[\n  {\n    \"path\": \"~/.config/fish\",\n    \"only\": [\"functions\"],\n    \"exclude\": [\"completions\"]\n  }\n]\n```\n\nThe `links` options allows to create symlinks after restoring. It is a list of\neither strings or lists of 2 string elements. If the element is a string, then a\nsymlink will be created pointing to `path`. If it a list of 2 strings, the\nsecond is the symlink and will point to `path`/`first element`. In the example,\n`~/.vimrc` will point to `~/.config/nvim/init.nvim` and `~/neovim` will point to\n`~/.config/nvim`.\n\n```json\n[\n  {\n    \"path\": \"~/.config/nvim\",\n    \"links\": [\"~/neovim\", [\"init.vim\", \"~/.vimrc\"]]\n  }\n]\n```\n\nIt is also possible to run commands to do the backup/restore.\n\n```json\n[\n  {\n    \"backup\": \"brew leaves\",\n    \"restore\": \"xargs brew install\",\n    \"alias\": \"brew.leaves\"\n  }\n]\n```\n\nThis is the same as backing up with\n\n```sh\nbrew leaves > brew.leaves\n```\n\nand then restoring with\n\n```sh\ncat brew.leaves | xargs brew install\n```\n\nThe current working directory is changed to the folder containing the\nconfiguration file before executing anything, so if you want to specify files in\nthe command line, remember that: you need to quote file paths if they contain\nspaces and your `alias` file is in `dotfiles/:alias\"`.\n\n## LICENSE\n\nThe MIT License (MIT)\n\nCopyright (c) 2021 \u00c1lan Cr\u00edstoffer e Sousa\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Dotfiles backup and restore tool",
    "version": "1.0.5",
    "project_urls": {
        "Homepage": "https://github.com/acristoffers/dbkp",
        "Repository": "https://github.com/acristoffers/dbkp"
    },
    "split_keywords": [
        "dotfiles",
        "backup",
        "restore",
        "manager"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "769ce6386bdabce5674f87a6912a67480e5cbc5d020f7dccac55ed8902adf699",
                "md5": "c75ea7e43cced9df008d47b31af69b67",
                "sha256": "918d50b5942ec9a6ada962634e990d8d48df1cea408ed58e5e7b8fd804e50668"
            },
            "downloads": -1,
            "filename": "dbkp-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c75ea7e43cced9df008d47b31af69b67",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8432,
            "upload_time": "2024-01-16T08:01:26",
            "upload_time_iso_8601": "2024-01-16T08:01:26.316880Z",
            "url": "https://files.pythonhosted.org/packages/76/9c/e6386bdabce5674f87a6912a67480e5cbc5d020f7dccac55ed8902adf699/dbkp-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98a599f4970ac56ef5573c4ac50401cecd3347425a84c682bf7ea33312666ea0",
                "md5": "68f53fcdbc78952a223750ac2476fa0e",
                "sha256": "8a026e2323f4feaecb24339e9fd924145d80eb884bad0656ed7217a6553d0470"
            },
            "downloads": -1,
            "filename": "dbkp-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "68f53fcdbc78952a223750ac2476fa0e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4954,
            "upload_time": "2024-01-16T08:01:27",
            "upload_time_iso_8601": "2024-01-16T08:01:27.362434Z",
            "url": "https://files.pythonhosted.org/packages/98/a5/99f4970ac56ef5573c4ac50401cecd3347425a84c682bf7ea33312666ea0/dbkp-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-16 08:01:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "acristoffers",
    "github_project": "dbkp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "dbkp"
}
        
Elapsed time: 0.24556s