- 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/c
absolute path file will be backup to_a-b/c
~/.xx/yy
directory in user home will be backup to~+xx/yy
~/xx/yy/zz
directory in user home will be backup to~xx-yy/zz
~/.xx
file will backup toxx.symlink
~/.xx
directory will backup to~+xx.symlink
- every
xx.symlink
file will soft link into~
directory - every
~+xx.symlink
directory will soft link into~
directory - every
~xx.symlink
directory 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.py
script and you config files and directories will be backed up and linked back to original path
python3 my_configs.py