Easily Manage Dot Files (Config Files)

#
#!/bin/bash
declare -a filesToSync=(".bashrc" ".bash_history" ".zshrc" ".zsh_history" ".gitignore_global" ".gitconfig")
## now loop through the above array
for i in "${filesToSync[@]}"
do
cp ~/$i ~/dotfiles/$i
# or do whatever with individual element of the array
done
declare -a foldersToSync=(".config/Terminator",".config/JetBrains") ## now loop through the above array
for i in "${foldersToSync[@]}"
do
cp -r ~/$i ~/dotfiles
## or do whatever with individual element of the array
done
##!/bin/bashcd ~/dotfilesbash syncfile.shgit add .git commit -m “weekly changes”git push -u origin master -f 
0 0 * * 0 bash /home/ujwal/dotfiles/cronscript.sh

Conclusion

Every week my config files are getting synced automatically and i dont need to remember at all.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store