Using Git to Track override-common.properties
Git is a free and open source distributed version control system.
The PSM server installation automatically creates
a Git repository for /var/local/ems9001/conf and automatically adds the override-common.properties file to that repository. This allows you to track all updates to
that file.
Every time you update the override-common.properties file, issue a git commit command and
indicate the reason for the update. For example:
[user conf]# git commit -m "Changed automated NE backup time. By user@example.org." override-common.properties
The text in quotations is freeform, and is used to specify the reason for the update and to identify the user who is making the change.
Here is a sample output of the git commit command:
[master a80a2f3] Changed automated NE backup time. By user@example.org.
Committer: user <user@example.org>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 files changed, 1 insertions(+), 1 deletions(-)
[user conf]#
To view the log of changes, use the git log command. For example:
[user conf]# git log override-common.properties
This produces a log of all the changes made to the file, with the most recent change listed first:
commit a80a2f33cdbf27e1b7973f93360a82471f1249f2
Author: user <user@example.org>
Date: Thu May 30 14:22:56 2013 -0400
Changed automated NE backup time. By user@example.org.
commit 187bf1786d7da5153a04c30611ed44d49ebf6974
Author: user <user@example.org>
Date: Thu May 30 14:20:25 2013 -0400
Enabled historical PM collection. By user@example.org.
commit 6835ba91cce1b8a8f2c5414315fc035b6e7545c8
Author: user <user@example.org>
Date: Thu May 30 14:13:50 2013 -0400
conf initial configuration
[user conf]#
To view the log of changes and their differences, use the git log -u <start>..<end> command. If <end> is omitted, the log will include all changes from <start> up to the most recent update. In this example, to view a log of all changes after installation:
[user conf]# git log -u 6835ba91cce1b8a8f2c5414315fc035b6e7545c8.. override-common.properties
This command shows the log of changes and their differences starting from the commit identifier 6835ba91cce1b8a8f2c5414315fc035b6e7545c8, which in this example is immediately after installation. The output is as follows:
commit a80a2f33cdbf27e1b7973f93360a82471f1249f2
Author: user <user@example.org>
Date: Thu May 30 14:22:56 2013 -0400
Changed automated NE backup time. By user@example.org.
diff --git a/override-common.properties b/override-common.properties
index 8aa0651..3e77f16 100644
--- a/override-common.properties
+++ b/override-common.properties
@@ -268,7 +268,7 @@ schedule.watchdog.cron=0 0/2 * * * ?
// Schedule for generating NE database backups for the subset of all known devices. (Note: Number of parallel backups is defined implicitly by workers' pool task configuration)
// Every day at 4:15 a.m.
// Note: Problems were observed when full backups are run every 20sec's because parallel backups were running.
-schedule.neDbBackup.cron=0 15 4 * * ?
+schedule.neDbBackup.cron=0 15 3 * * ?
// Schedule for retrieving the current FTP server status.
// Every 5 minutes ...
commit 187bf1786d7da5153a04c30611ed44d49ebf6974
Author: user <user@example.org>
Date: Thu May 30 14:20:25 2013 -0400
Enabled historical PM collection. By user@example.org.
diff --git a/override-common.properties b/override-common.properties
index 205c6d7..8aa0651 100644
--- a/override-common.properties
+++ b/override-common.properties
@@ -384,7 +384,7 @@ carbon.host=localhost
carbon.linePort=2003
// Switch for turning on/off the scheduled historical PM collection.
-pm.historical.collectionEnabled=false
+pm.historical.collectionEnabled=true
// Mappings of PSM roles to comma-separated list of RADIUS roles.
[user conf]#
In the above example, at 14:20:25, user@example.org changed pm.historical.collectionEnabled to true, and at 14:22:56, user@example.org changed schedule.neDbBackup.cron to be at 3:15 every morning.
If you have forgotten whether you have performed a git commit or not, use the git status command to check the status. For example:
[user conf]# git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: override-common.properties # no changes added to commit (use "git add" and/or "git commit -a") [user conf]#
The above output tells you that the override-common.properties file has been modified but not committed.
For more information on Git, see http://git-scm.com/.