Package: dbkp
dbkp - dotfiles backupdbkp simply backups and restores dotfiles usingrsync -La. You can use it with
any version control or backup strategy you want.InstalationInstall with pip:pip3 install dbkpUsagePut the file dbkp.json on a folder and configure it as you want. Then either rundbkp backupfrom the folder or pass the path to the configuration file asdbkp 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. Usedbkp restorein the same way to rsync the files from the dotfiles
folder into their places.Configuration exampleThe 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:["~/.vimrc"]It is the same as[{"path":"~/.vimrc","alias":"vimrc"}]aliasis 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 bothonlyandexclude, butexcludewill be ignored in this case.onlywill remove all files but the ones listed andexcludewill only exclude
the ones listed.[{"path":"~/.config/fish","only":["functions"],"exclude":["completions"]}]Thelinksoptions 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 topath. If it a list of 2 strings, the
second is the symlink and will point topath/first element. In the example,~/.vimrcwill point to~/.config/nvim/init.nvimand~/neovimwill point to~/.config/nvim.[{"path":"~/.config/nvim","links":["~/neovim",["init.vim","~/.vimrc"]]}]It is also possible to run commands to do the backup/restore.[{"backup":"brew leaves","restore":"xargs brew install","alias":"brew.leaves"}]This is the same as backing up withbrewleaves>brew.leavesand then restoring withcatbrew.leaves|xargsbrewinstallThe 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 youraliasfile is indotfiles/:alias".LICENSEThe MIT License (MIT)Copyright (c) 2021 Álan Crístoffer e SousaPermission 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.