Donnerstag, 16. Februar 2012

etckeeper-ng: Taking the distributed version control to the next level

Update:
A lot has changed since the last time i wrote about this project. First i moved the project to a different github.
Since the project and the code has gotten more complex. i separated etckeepr-ng completely from bashtools and spited up the functions in modularized files. Each function lives in his own file now.
So far i announced version 0.2.1 which is still to buggy for use in a productive environment although i fixed most known bugs i found.
I do have speakable commands now because they are more flexible to add than - options. Type "etckepper-ng help" to view all commands known for etckeeper-ng. There are however some new commands as you might have noticed already. With "reset" at least you are able to reset /etc to the last backed up commit. A smaller command is the "list-excludes" command which simply does a cat on your $EXCLUDEFILE.
Also i wrote etckkerper-ng it is able to parse Variables from the configuration file /etc/keeper.conf
There is a lot todo for now. So if you are a programmer and able to help to hack on etckeeper-ng you are welcome to check out the git repository and ask back for a push request. Also report bugs to me whenever you might find one.

Update:
Santas Hacking night :D
I got the -f option working for backup one single file. I strongly recommend using this for doing backups now every time you change a configuration file. It's a lot faster to backup just one file instead of doing this for the whole /etc all the time. Also this might be more secure since you only need to backup files which you are sure about. Before doing a backup use -c option to verify what has changed After verifying these changes add those files to the backup and be certain this changes are ok.

Update:
fixed some bugs in the Script today. Also the Script detects a change with the -c Option, the diff is logged to a logfile. So you can see what has changed.
I have completely disabled the -r Option though since this was highly unusa
ble.

Hi girls and guys,

today i present you with a new incarnation of the etckeeper. My Script etckeeper-ng rsyncs the /etc directory into a backup directory. As usual you can find the etckeeper-ng in my github directory and get it from there.

By default the Script syncs the /etc to /root/.etcbackup/. You can change this by editing the $BACKUPDIR variable in the script.

After initializing the Script with -i option it saves a copy of /etc to /root/.etcbackup/etc and a file /root/.etcbackup/content.bak which contains the permissions user and owner of every file in the original /etc directory. All files under $BACKUPDIR than gets under version control by git.

Whenever you have done some changes in the configuration files, you can check them in and commit them to git by using the -b option to etckeeper-ng. The Backup function takes a little bit longer though, since the script also tests whether any permission or ownership or groupship has changed. In this case the Script will ask you, if you would like to restore the original permissions or commit the changed permissions and store them in the content.bak file.

You can list your commits by using the -l option.

However you will be notified that you should define some files like /etc/passwd or /etc/shadow that should not be included in the backup. You can define the /etc/passwd
file from being backed up by issuing the Script etckeeper-ng -e passwd. You have to give the relative path from /etc to say which files you wish to exlclude from being backed up. This will create a file /root/.etcbackup/excludes which will be read by the rsync programm with the --exclude-from option.

Checking if someone has something changed can be archived by using the -c option. This will create a second copy of the backup directory and will rsync the /etc to this particular second copy. The directory can be set by editing the variable $COMPAREDIR. The script will use git status -s and a check function for the permissions to check against content.bak if the user, the group and the permissions of all files are genuine.

If someone or yourself by accident change the permissions of a particular file you can reset this by using the -C option. Note: It's a capital C.

And finaly restoring the /etc directory can be archived by using the -r
were you can use HEAD restoring from the latest commit or the md5sum which is listed after "commit" when you using -l

Hope this script makes the live a little bit easier for you.

And please tell me if you find any bugs.


That's all folks.

Dienstag, 7. Februar 2012

Sind wir jetzt per Sie?

Gut dass sich ein Laden der sich hauptsächlich von Arbeitslosen ernährt ironischer Weise "PerZukunft" nennt kann man vielleicht noch irgendwie verstehen. Drinnen kann man, ganz nebenbei gesagt auch meinen Namen nicht korrekt aussprechen. Werde abwechselnd von den Damen Herr Prumps, Herr Prost oder auch gerne mal Herr Ropst gennannt.

Aber diese Per-siflage geht draußen auch weiter. Als Alternative sehe ich auf einem Plakat dass vor allem ein "Erfolg per Hochschulstudium" gebraucht wird, während ich in einem U-Bahnhofe "per Kamera" überwacht werde.

Schnell fahre ich mit der U-Bahn in die Bibliothek wo man mich fragt, als ich ein Buch vorbestelle, ob ich denn "per E-Mail" darüber Bescheid bekommen möchte wenn dieses aus dem Magazin verfügbar ist. Es ginge auch "per SMS" sagt man mir, während ich mich frage ob es nicht schöner klingt, wenn man mir dieses auch mittels einer E-Mail mitteilen könnte.

Das Buch unterm Arm komme ich noch einer Zahlungsaufforderung eines größeren Onlinehauses nach, welche ich"per Rechnung" erhielt und bin froh darüber das die Überweisung "per Sofort" geschieht. Das dass "per" hier sogar völlig sinnlos ist, sei nur nebenbei erwähnt. Danach trinke ich einen Kaffee am Stand eines Bäckers "per Tasse" . (Kein Witz) 2 Anrufe in Abwesenheit von jemanden der mir sowie so schon längere Zeit auf den Keks geht. Er erklärt mir er hätte mich nun schon die ganze Zeit über versucht "per Handy" zu erreichen. Ich antworte: "Na dann ist ja gut. Und ich habe gedacht, du hättest versucht mich auf dem Handy zu erreichen."

Mein Freund der gerade ein Reise per äh entschulden Sie mich nach Indien macht schreibt mir:
dass er nun per Boot auf einem Fluss zu Monkey Island fahre. Ich korrigiere seine Grammatik und ernte von jemanden dafür ein +1. Wenigstens etwas.