Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 744 of 807  Not logged in ELOG logo
ID Date Icon Authordown Author Email Category OS ELOG Version Subject
  67454   Fri Feb 22 10:58:18 2013 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionLinux2.92Re: any way to undelete entries?

Mark Bergman wrote:

 Is there any way within eLog to undelete entries?

 I wrote to scripts to backup the logbook files:

  • elog_backup_daily creates a tar file of all new entries of the last 25 hours and keeps these backups for 90 days
  • elog_backup_hourly creates a tar file of the entries of the last 65 minutes and keeks these backups for one week
  • exclude-logbooks specifies which files not to backup

This allows you at least to recover deleted entries by hand as an administrator.

 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 
Attachment 1: elog_backup_daily
#!/bin/sh
# source file directory
srcd=/usr/local/elog/

# backup all files newer than 25 hours
date=$(date -d "-25hours" "+%Y%m%d %H:%M")
# backup file directory
tard=/logbooks_backup
# backup tar file name
tarf=$tard/$(date +%Y%m%d_%a.tar)
# do not backup files that match patterns in this file
excf=/usr/local/elog/utilities/exclude-logbooks
# create backup
cd $srcd
tar --ignore-case -X $excf --newer "$date" -cf $tarf . logbooks/*

# copy passwd.txt
if [ "$(date +%u)" -eq 1 ]
then
	passwd=$tard/passwd_$(date +%Y%m%d_%a.txt)
	cp $srcd/passwd.txt $passwd
	gzip -9 $passwd
fi
# delete all backups older than 90 days
find $tard -mtime +90 -name "*_???.tar"           -exec rm -f {} +
find $tard -mtime +90 -name "passwd_*_???.txt.gz" -exec rm -f {} +
Attachment 2: elog_backup_hourly
#!/bin/sh
# source file directory
srcd=/usr/local/elog/

# backup all files newer than 25 hours
date=$(date -d "-65minutes" "+%Y%m%d %H:%M")
# backup file directory
tard=/logbooks_backup
# backup tar file name
tarf=$tard/$(date +%a%H%M.tar)
rm -f $tarf
# do not backup files that match patterns in this file
excf=/usr/local/elog/utilities/exclude-logbooks
# create backup
cd $srcd
tar --ignore-case -X $excf --newer "$date" -cf $tarf . logbooks/*
Attachment 3: exclude-logbooks
*.png.png
*.gif.png
*.jpg.png
*.pdf.png
oldLogbooks/*
logbooks/elog.log
passwd.txt
ssl/*
logbooks/Backup/*
logbooks/old/*

  67488   Mon Apr 29 10:17:54 2013 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionLinux2.5.2Re: Auto-Generate new logbook daily

David Pilgram wrote:

Stefan Ritt wrote:

Ryan Blakeslee wrote:

Hello,

I am currently using ELOG as a daily logbook for work performed for customers.  This is a critical tool and process for 1. Showing customers work history 2. having a searchable knowledge base for future reference.  

Currently, I will create a new log entry, assign the customer using a custom ROPTION in my elog.conf.  This process all works fine, mostly, except I run into the following obstacles (that are all human related.)

1. Many days, there are no log entries to be created for a PARTICULAR customer, and other days there are no long entries to be created for ANY customer.

2. Many days when there is a log entry to be created, it's created by me much later then when the work was performed.  For example, I do a bunch of work Tuesday and Wednesday, but I don't have time to enter all my entries until Thursday.  

2A. In this case, I have to manually go back and edit the log entries with text-editor to adjust the times, dates, and such.

2B. In this case, I have log files with a file-name of THURSDAY (042513a.log) for work entries done on Tues and Wed, so I have to go back and rename the log files for consistency sake (mv 042513a.log 042313a.log).  ** I know this is not a requirement of the program, but I like to have the log filenames consistent with the dates contained in them.

 

All these I admit are human error -- but as a small business owner, I just can't always get to the log entries every day.

 

To overcome this, the manual solution would: at the beginning of each day, create a new log entry -- regardless of work to be performed and updated later.  This would serve as sort of a place holder.

However, I can't commit myself to always create a log entry for every day either.  Again, human error.

 

Is what I would like to be able to do is create a new log entry, every single day, automatically.  I would then have a growing log dir of daily log entries (files) for ever day of the week, most blank but some would then contain data that I enter later-- either at the end-of-day or on a day I have downtime and can commit to administrative work.

My thought is I could probably schedule a cron job do to this, but i'm not completely sure how I would go about auto-populating the incremental ID's, dates, etc.  Second, I don't know if there is a way to do this within ELOG itself, or if there is a built-in mechanism that already covers this.

 

Has anyone run into this, or solved this problem, or can someone kindly point me in the right direction or how I can implement the daily auto creation of logs?

 

Thank you very much in advance!

Actually I would not worry with the 042313a.log files. In a future version of elog they might be replaced by a database or so. I see two options:

  1. Add an attribute of date/time type. You do that with "Type <attribute> = datetime". Then you can assign a certain date or time to each entry you do. That means you can tag an entry with the date of yesterday or so. If you make that date then the main database key (via "List display") it basically replaces your "internal" date.
  2. You can do automatic entries with the "elog" utility coming with the distribution and described here. This you can even run from a cron job. If you submit a new entry from elog, you get automatically the incremented IDs etc. You can use some default values for the attributes, which you can change later.

 Purists look away now.

I have the same issues regarding "catching up" of entries.  So what I do is use the date command to reset the computer's time back to the time that the entry [i]should[/i] have been made.  Say I need to put an entry for last Thursday (today is Saturday 27th),

Firstly I set the clock back by

date 04252200

(I use a time of 22:00 or later as code for a retro-made entry, the date being the important point for me).

Then any entry will have the correct time (sic) and date entry within the file, and the file the expected format of 130425a.log

After Thursday's batch of entries, I then simply reset the clock for the next entry/ies or indeed back to real time.

Mind you, my log files have the format yymmdda.log, whereas you state yours are mmddyya.log, which strikes me as a very high degree of flexibility!

 

---

Nice to meet someone else who gets down to the bare ascii and knows how to edit the xxxxxxa.log files!

Just my two cent:
I would strongly recomment NOT to go back and forth with the system time.
In some cases this can cause you severe problems with your control system.
 
Stefans suggestion works fine for our operations logbook: I've just introduced an attribute "When" and sort my entries according to this attribute.
The line in the config:
Start page = ?rsort=When
takes care that this sorting is the default.
 
The advantage of this approach is in addition, that you keep track of both dates:
the date when the work had been performed and
the date when you've actually entered the information.
Sometimes that turns out to be useful to me to figure out what I did and when ;-)
 
As to editing the bare ascii: I do this a lot, even with sed scripts.
But there is a disclaimer: you can crash elogd with corrupted entries and you may have a hard time figuring out why it crashes.
For example accidentally deleting a digit in a cross reference can create a loop that causes elogd to get non-responsive without error: try to find that!
I would strongly advise not to build any user application build on editing the ascii files. Just use it for system administration.
 
Andreas
--
He who knows others is wise.
He who knows himself is enlightened.
                -- Lao Tsu
 
 
Detect language » English
 
  67503   Mon May 13 22:31:37 2013 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionLinux2.5.2Re: Auto-Generate new logbook daily

David Pilgram wrote:

 

[...]

As for the computer time switching, I am aware of the issues, it's a stand-alone linux box, I've found elog to be surprisingly tolerant, everything's backed up.  The introduction of a 'When' attribute had better be on new logbooks or introduced at end of year (esp during quiet time) so that existing books don't fail to find what I'm looking for in searches.

[...]

Yes, adding a new attribute in a logbook is not straight forward.

But it is doable: that is one of the things that I write SED scripts for. You just need to add the attribute in all old entries, and in this specific case you can use the entry time to initialise the "when" attribute.

Of course I would only do that on a copy of my data and run a separate elogd server on that data to see if anything is screwed up :-)

Cheers
Andreas
 
Detect language » English
 
 

 

  67505   Wed May 15 23:31:30 2013 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionWindowsELOG V2.7.Re: Export entries to XLS or CSV?

scogordo wrote:

I've been asked to export one of our logbooks to xls or csv. Doable?

Thanks,
Scott

Hi Scott,

yes, every user can export entries using the "find" command.
Just select the export format in the first line

Export to:  

 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 

I often use the XML Format, but CSV is fine if you just want to import the entries to some spreadsheet program.

I was shocked to find out that this feature has not yet made it into the documentation?!? But it is that simple to use that there is not much to document.

There is even an "Import" command, to reimport entries from a file. But this is tricky to use: if you have fields of type date or datetime, then you have to convert those fields in the proper format.

Attachment 1: elog-find.png
elog-find.png
  67510   Tue May 21 14:33:09 2013 Reply Andreas Luedekeandreas.luedeke@psi.chBug reportWindowsUnknownRe: Application failed to initialize properly

Norm wrote:

I attempted to install the newest version of elog on our site elog server from an old old version.  Around 2008 I believe.  I then received an application failed to initialize properly 0xc0150002 after installing the newest version.  I then tried installing the Feb 2013 version and received the same message.  Panicked, I rolled back our server to its state yesterday.  I would like to update our elog software, anyone know why I am receiving this error??

 Hi Norm. I have not much experience with windows, but I can give you my two cent on how to proceed:

  • Check the old elogd version. It is shown at the bottom of your elog web page (this forum shows ELOG V2.9.2-2475).
  • Copy your logbook data to a different PC, maybe your office PC.
  • Then compile the latest elog on your office PC, run it with the copied data and access it as http://localhost:8080 (or whatever port number you are using)
  • If it is still crashing: re-compile it using "make debug" and run it from a debugger (I don't know any C-debugger for Windows). Post the precise error message.
 
Detect language » English
 

Good luck!

  67516   Wed May 29 14:57:23 2013 Reply Andreas Luedekeandreas.luedeke@psi.chInfoLinux2.8-2350Re: hyperlink other elog posts

Remington Tyler Thornton wrote:

I am on an experiment that used ELOG for all documentation and meeting notes. In our meeting notes we link to elog posts that had been discussed during the meeting. We had done this by hyperlinking the URL to the entry. Recently we had to move our logbook to another machine and so none of our hyperlinks work since the URLs have changed. I noticed that when one creates a new entry in the subject they can reference another post. Is there a way to link another elog in the body of the elog by using its logbook name and id number without having to use a URL?

Thanks in advance

This is one of the rare cases where it helps to read the manual: https://midas.psi.ch/elog/userguide.html#add (You may need to upgrade to elog 2.9)

If you want to replace the old URLs with the new ones, you can edit the logbook files with the entries. The attached script allows you to do so easily. But be careful, try it on a copy of your data first.

 
Detect language » English
 
 
Detect language » English
 
Using:
regreplace "<old-url>" "<new-url>" *a.log
 
I hope this helps.
Andreas
Attachment 1: regreplace
#!/bin/bash
if [ $# -lt 3 ]
then
	echo "using: $0 <search-for> <replace-with> <file-list>"
	exit
fi
if [ "$1" = "-f" ]
then 
	flag="-f"
	shift 1
else
	flag="-i"
fi
search="$(echo "$1"|awk '{gsub("\\","\\\\");gsub("/","\\/");print $0}')"
replace="$(echo "$2"|awk '{gsub("\\","\\\\");gsub("[$]","\\$");gsub("/","\\/");print $0}')"
shift 2
echo "replace \"$search\" with \"$replace\" in the files "
bold=`tput smso`
offbold=`tput rmso`
for file in $(grep -l "$search" "$@")
do
	tmp=/tmp/regreplace_$(basename $file)
	sed "s/${search}/${replace}/g" $file >$tmp
	
	echo "${bold}diffs of $file$offbold ('<' = before, '>' = after)"
	diff $file $tmp
	cp $flag $tmp $file
        rm -f $tmp
done
  67518   Fri May 31 11:41:48 2013 Reply Andreas Luedekeandreas.luedeke@psi.chBug fixAll2.9.2-2481Re: Export entries to XLS or CSV?

Jim Tinlin wrote:

Andreas Luedeke wrote:

scogordo wrote:

I've been asked to export one of our logbooks to xls or csv. Doable?

Thanks,
Scott

Hi Scott,

yes, every user can export entries using the "find" command.
Just select the export format in the first line

Export to:  

 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 
 
Detect language » English
 

I often use the XML Format, but CSV is fine if you just want to import the entries to some spreadsheet program.

I was shocked to find out that this feature has not yet made it into the documentation?!? But it is that simple to use that there is not much to document.

There is even an "Import" command, to reimport entries from a file. But this is tricky to use: if you have fields of type date or datetime, then you have to convert those fields in the proper format.

I tried EXPORTING logbooks as .csv but have not been fully successful.  Elog seems to only export the data entered for various fields with the exception of the text field.

Here is an example export from my logbook (used to track simulator problems), I would like to also export the TEXT field so it can be used by my managers in excel...but as you can see there is no entry for "TEXT" fields...

Thanks in advance!

"Message ID","Date","Author","Type","Status","Priority"

107,Thu  30 May 2013 11:28:57 -0700,"Jim Tinlin","Graphic Display","Evaluated","Low"

106,Thu  30 May 2013 10:02:24 -0700,"Jim Tinlin","Graphic Display","Identified","Low"

105,Thu  30 May 2013 08:07:27 -0700,"Jim Tinlin","Problem ID","Identified","Medium"

104,Thu  30 May 2013 08:04:30 -0700,"Jim Tinlin","Problem ID","Identified","Medium"

103,Wed  29 May 2013 09:36:11 -0700,"Jim Tinlin","Problem ID","Evaluated","High"

102,Wed  29 May 2013 08:58:02 -0700,"Jim Tinlin","Problem ID","Evaluated","High"

Yes, you're right: the text field is only exported in XML and Raw mode.
It is questionable how EXCEL should cope with HTML or ELCode output from the text fields.
But I admit that this would be a useful feature for logbooks that only use plain text entries. And it is simple to implement.
 
I've attached a patch to elogd.c from elog-2.9.2-2081 that adds a third CVS mode 'CSV (";" separated) + Text'.
(This string has not yet been added to the localization.)
As far as I've tested it works fine to import the text to OpenOffice and EXCEL, even with multiple text lines and HTML code in the text.
Of course the spreadsheet programs just display the HTML source.
 
Stefan, do you think this should be added to the official branch?

 

 
Detect language » English
 
 
Detect language » English
 
Attachment 1: diff.txt
11645,11650d11644
<    if (strieq(mode, "CSV3"))
<       rsprintf("<input type=radio id=\"CSV3\" name=\"mode\" value=\"CSV3\" checked>");
<    else
<       rsprintf("<input type=radio id=\"CSV3\" name=\"mode\" value=\"CSV3\">");
<    rsprintf("<label for=\"CSV3\">%s&nbsp;&nbsp;</label>\n", loc("CSV (\";\" separated) + Text"));
< 
19535c19529
<    csv = strieq(mode, "CSV1") || strieq(mode, "CSV2") || strieq(mode, "CSV3");
---
>    csv = strieq(mode, "CSV1") || strieq(mode, "CSV2");
20266,20268c20260
<          } else {
<             if (strieq(mode, "CSV3"))
<                 rsprintf(";\"Text\"");
---
>          } else
20270d20261
<          }
20973,20987c20964
<             } else {
<                if (strlen(text)>0 && strieq(mode, "CSV3")) {
<                   rsprintf(";");
<                   strlcpy(str, text, sizeof(str));
<                   rsputs("\"");
<                   pt1 = str;
<                   while ((pt2 = strchr(pt1, '"')) != NULL) {
<                      *pt2 = 0;
<                      rsputs(pt1);
<                      rsputs("\"\"");
<                      pt1 = pt2 + 1;
<                   }
<                   rsputs(pt1);
<                   rsputs("\"");
<                }
---
>             } else
20989d20965
<             }
  67520   Mon Jun 3 13:56:35 2013 Reply Andreas Luedekeandreas.luedeke@psi.chBug reportWindowsUnknownRe: Application failed to initialize properly

Norm wrote:

Andreas Luedeke wrote:

Norm wrote:

I attempted to install the newest version of elog on our site elog server from an old old version.  Around 2008 I believe.  I then received an application failed to initialize properly 0xc0150002 after installing the newest version.  I then tried installing the Feb 2013 version and received the same message.  Panicked, I rolled back our server to its state yesterday.  I would like to update our elog software, anyone know why I am receiving this error??

 Hi Norm. I have not much experience with windows, but I can give you my two cent on how to proceed:

  • Check the old elogd version. It is shown at the bottom of your elog web page (this forum shows ELOG V2.9.2-2475).
  • Copy your logbook data to a different PC, maybe your office PC.
  • Then compile the latest elog on your office PC, run it with the copied data and access it as http://localhost:8080 (or whatever port number you are using)
  • If it is still crashing: re-compile it using "make debug" and run it from a debugger (I don't know any C-debugger for Windows). Post the precise error message.
 
Detect language » English
 

Good luck!

Andreas,

We do not have the current revision at the bottom of any of the pages.  Is there another way I can find out the current revision I'm using?

Thanks!

Try:

/usr/local/sbin/elogd -h

 
Detect language » English
 

This is the path for Linux, it is likely different on Windows. But you could just run "elogd -h" in the directory where you compile elogd.

It should print out the version in the first line.

ELOG V3.1.5-3fb85fa6