Backup your packages, apps, and configurations directly to git in the form of profiles. Set up any new (virtual) machine using a profile in one line. Share profiles between multiple machines. Configure auto update, clean-up, and back-up. Works for all linux flavors, Mac OS, and Windows.
All installation and backup scripts require you to pass a profile name as their first argument. If you provide no profile name to a script, they'll use the default personal
profile.
Example use:
# Set up your new machine quickly using a profile
install.sh <profile-name>
# Assume you're customising your installation here by installing new packages, editing shell configuration, etc
backup.sh <profile-name>
# Now if you're working on your own fork, you can commit this profile and later use it to set up new machines or make reinstallations way easier!
To simplify instructions, the paths provided in this README are for macOS scripts. However, these all have their counterparts for other OSs. You just need to replace the macos
part with linux
or windows
, or unix
part with windows
. Sometimes additional minor changes to the path are required as well but it should all be clear and intuitive.
First, fork this repository and clone it on your machine. Then:
<project-dir>/scripts/unix/backup.sh <profile-name>
This will back-up your packages, apps, and configurations to the profile you've given - personal
if left blank. Creating the profile as necessary if it doesn't exist.
The following steps assume that you are doing the setup on a freshly formatted computer. Therefore you don't even have your SSH keys or anything set up.
Open the Terminal app and enter the commands below.
mkdir ~/projects
cd ~/projects
# It's recommended to use your own fork so you can commit your profile changes later on.
git clone https://github.com/isair/dotfiles.git
cd dotfiles
If your setup does not come with git
, download this project from its GitHub page instead. Later on, the profile you install will most likely have git
.
Before typing the following line, make sure you check the various profiles under the profiles
directory and pick one that suits your needs.
./scripts/macos/install.sh <profile-name>
One way to automate backup and cleanup is to add cron jobs for these scripts.
crontab -e
Append the following line, changing the path as necessary.
0 15 * * * ~/projects/dotfiles/scripts/unix/backup.sh <profile-name>
This will update your package list but you'll still need to commit and push yourself, or write a script for it.
sudo crontab -e
Append the following line, changing the path again as needed.
00 8 * * * /home/owner/projects/dotfiles/scripts/unix/update.sh
00 9 * * * /home/owner/projects/dotfiles/scripts/unix/cleanup.sh
Your computer will now update everything and clean-up disk space in the morning. At 15:00, it will do backups.
All dot files are symlinked to your project clone directory. The update script is also responsible for git pull
ing any changes made to the repo. Therefore, if you have set up automatic updates as mentioned in the previous section, all you need to do is git push
your changes! Any machine installed using the same profile will automatically get them when their update script runs again.
The back-up scripts support the following package managers.
- brew
- brew cask
- npm
- pip
- brew
- apt
- snap
- npm
- pip
- scoop
- bash
- zshell
- profile
- hyper.js
- vim
- ssh
Commit scopes:
- profiles
- scripts
- repo