RCS Tips for the System Administrator

Introduction:

The Revision Control System (RCS) is a program available from gnu.org that manages multiple revisions of files.  This is a very useful tool for the system administrator who is constantly maintaining a library of procedures, scripts and web content.  RCS allows us to have a single working copy and be able to update it without maintaining multiple revision copies.  RCS handles all of the revisions invisibly, and give us the capability of going back to any previous revision of the document as necessary.

RCS is available under Linux and Windows.  RCS makes it's own copy of the document which retains all of the changes.  Under Linux this file has the same name as the document with the addition of ",v" to the file name.  Under windows RCS keeps it's copy of the docment in an RCS folder in the same directory as the document (by default).
 

Checking In a Document:

To start using RCS you must "check in" the document.  This is done with the following command:

ci -l <filename>

Whenever you check in a document, RCS will ask for a description.  The description can be multiple lines and can be stopped by typing a period "." on it's own line in the description.  The -l refers to a file lock.  Without the -l, the file cannot be edited.  By using the -l, the file can be changed and then checked in again after the edits have been completed.

After you make additional changes to the document, you can check it in again, with the same command.  RCS again will ask for a description and will update it's revision number of the document.
 

Reviewing the Revision Log

You can review the list of revisions that RCS is maintaining by the the following command:

rlog <filename>

The result will be a list of all revisions,  along with their descriptions.
 

Checking Out a Document:

It may be necessary to check out a document from RCS.  This will allow you to go back to a known version of the document.  To go back to the latest version of the document that RCS knows about use the following command:

co -l <filename>

RCS will extract the latest version of the document from it's file.  Becareful, this may overwrite the copy in the directory that you are using.

To check out a particular revision, use the following command:

co -l -r1.x <filename>

where 1.x is the revision, such as 1.1, 1.2, 1.3, etc.
 

Troubleshooting

If there have been no changes, but you want to check in the file anyway, you may force a check in with the following command:

ci -l -f <filename>

If ci -l <filename> does not work, and you get a message about "no lock set by <user>", then the following commands will allow you to check in the file:

rcs -l <filename>
ci -l <filename>
 
 

Back To Main Page For List Of Other Documents


For more information, contact billetter@networktechnologist.com
http://www.networktechnologist.com/sysadmin/rcs.html