Wednesday, February 3, 2010

using comments at runtime

I maintain Linux-based systems. Sometimes on my own but mainly with other people. Normally we know what we are doing and why. Problems arise when you need to look back on a system to know who did what and why. May not always be clear from `history`. Why did user create this file? What did s/he need to edit /path/to/foo for?

This is a work around designed to be useful for me. Just slap a # "hash" after a command and use the remainder of the command as a place to store comments.


file *.tar.gz # check that these are really compressed
br_feb03_2010.tar.gz: gzip compressed data, from Unix, last modified: Wed Feb 3 10:46:59 2010
de_feb03_2010.tar.gz: gzip compressed data, from Unix, last modified: Wed Feb 3 11:37:56 2010
en_feb03_2010.tar.gz: gzip compressed data, from Unix, last modified: Wed Feb 3 11:48:25 2010
es_feb03_2010.tar.gz: gzip compressed data, from Unix, last modified: Wed Feb 3 11:48:42 2010
fr_feb03_2010.tar.gz: gzip compressed data, from Unix, last modified: Wed Feb 3 11:48:50 2010
it_feb03_2010.tar.gz: gzip compressed data, from Unix, last modified: Wed Feb 3 11:48:58 2010
jp_feb03_2010.tar.gz: gzip compressed data, from Unix, last modified: Wed Feb 3 11:49:07 2010
pl_feb03_2010.tar.gz: gzip compressed data, from Unix, last modified: Wed Feb 3 11:49:17 2010
pt_feb03_2010.tar.gz: gzip compressed data, from Unix, last modified: Wed Feb 3 11:49:25 2010


In X weeks time any one reading this user's history will see what I did and why.


history | tail -n 20
1112 ls # "solved" is working for de. now time to clean up. remember that we have a back up of the web stuff.. should have made a back up of the de ____database___ !!! as well !!!
1113 rm -fr install_project.php codeForNewPointSystem/ images.bak/ project-v00-26-01-10/
1114 ls
1115 rm -f cache/*php
1116 cd ../../
1117 ls
1118 tar zcf en_feb03_2010.tar.gz en
1119 tar zcf es_feb03_2010.tar.gz es
1120 tar zcf fr_feb03_2010.tar.gz fr
1121 tar zcf it_feb03_2010.tar.gz it
1122 tar zcf jp_feb03_2010.tar.gz jp
1123 tar zcf pl_feb03_2010.tar.gz pl
1124 tar zcf pt_feb03_2010.tar.gz pt
1125 # backups now made for all forums...
1126 ls
1127 mv en_feb03_2010.tar.gz en_feb03_2010.tar.gz
1128 ll
1129 mv de_feb03_1020.tar.gz de_feb03_2010.tar.gz
1130 file *.tar.gz # check that these are really compressed
1131 history | tail -n 20

No comments:

Post a Comment