HOWTO cvs home dir
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
This article is still a Stub. You can help Gentoo-Wiki by expanding it.
Contents |
[edit] Overview
This page will discuss how use CVS to archive your home directory. This article will assume you have a basic understanding of CVS and have a working CVS repository server. As time becomes available, or other authors contribute, this will be fleshed out to include more detailed steps.
[edit] Discussion
What value is there to archiving your home directory? Many users today find themselves using several computers, and finding that when they go to a new computer they end up spending too much time either griping about why this computer lacks a personal customization, or tweaking the account. This author has four such computers and found this solution to be a painless way to keep up-to-date on all servers.
[edit] Setup
The first thing I did was create a sub-home directory ~/home. I did this so I could decide what would be shared. I then copied all the dotfiles that I felt were universal (e.g. .zshrc). Put this home directory into CVS. Among the files you'll end up putting here is a .cvsignore that will be used to ignore certain dotfiles that are unique to a given server, and other directories that will individually remain in CVS. Basically, if it isn't a dotfile, I keep it in a sub-directory. Since I personally use vim, I kept .vim and .vimrc in this home directory
You probably won't want all your personal stuff on every computer you end up using. This author chose to have several sub-directories so he could decide which ones he wanted on a given computer. For example, on his work computer he did not import personal email and documents. Therefore, he created the following directories:
- ~/doc
- ~/tmp
- ~/bin
- ~/html
Each of these separately-CVS'd directories should find an entry in the .cvsignore file. This will help avoid the files and directories internal to these directories protected. Each of these directories are kept in a separate project.
[edit] Implementation
To make this work, I ensure I have a copy of my .zshrc file, or at least keep an available copy of the CVS environment variables. I get those variables into my environment, then use CVS to pull my home directory (without subdirectories) into my user account. From there, I 'mv' all the files from that home directory into my user account home (mv ~/home ~/.). I then rmdir that home directory. At this point, your home directory is basically set-up. Next, I check out the other sub-directories I want on the computer. In my setup, the actual directory names are "am_doc" instead of "doc," so when I finish the CVS pull, I move the directory to the new name.
By this point, you should have all the directories you want on a given computer. To keep updated, just CVS update the specific sub-directory and/or your home directory. Don't forget to commit. Now your home directory is in sync. When it's time to leave that computer for good, do a CVS up/commit, and rm ~/*. Now you haven't lost your information, but your privacy is maintained.
