- can specification where to backup the config files
- backup current file and directory as list in configurations
- convention over setting
- link file to destination position link files in special directory to destination
/a/b/cabsolute path file will be backup to_a-b/c~/.xx/yydirectory in user home will be backup to~+xx/yy~/xx/yy/zzdirectory in user home will be backup to~xx-yy/zz~/.xxfile will backup toxx.symlink~/.xxdirectory will backup to~+xx.symlink
- every
xx.symlinkfile will soft link into~directory - every
~+xx.symlinkdirectory will soft link into~directory - every
~xx.symlinkdirectory will soft link into~directory - every file and directory in directory with
~prefix but not suffix with+will link to~directory - every file and directory in directory with
_prefix will link to absolute path
- clone this repository
git clone https://github.com/alex-1q84/my-configs.git- set where you want to back up your config files in the
config.json, eg.
"backup_dir": "~/Dropbox/configs/"- list all the files and directories in the
config.json, eg.
"paths": [
"/usr/local/etc/shadowsocks-libev.json",
"~/.gitconfig",
"~/.config/fish",
"~/.vimrc"
]the final config.json file should look like as follows
{
"backup_dir": "~/Dropbox/configs/",
"paths": [
"/usr/local/etc/shadowsocks-libev.json",
"~/.gitconfig",
"~/.config/fish",
"~/.vimrc"
]
}- run the
my_configs.pyscript and you config files and directories will be backed up and linked back to original path
python3 my_configs.py