Create Batch files to save error log and recipe output in unique files

Case number:699969-998251
Topic:General
Opened by:brgreening
Status:Open
Type:Suggestion
Opened on:Thursday, July 31, 2014 - 19:43
Last modified:Friday, August 1, 2014 - 22:53

When running a recipe, Foldit creates a file called scriptlog.default.xml, and over writes the previous contents of this file. A batch file called o.bat will copy the information to a file in the C:\FolditLogs directory. This batch file should be run immediately after the script terminates, so that the data will not be overwritten.

copy C:\Foldit\scriptlog.default.xml C:\FolditLogs\%1_output.txt

When Foldit starts up, it creates a file called log.txt and over writes the previous contents of this file. When Foldit crashes, it is useful to get a copy of the log.txt file which may contain useful information for the development team. A batch file called e.bat will copy the information in the error log to a file in the C:\FolditLogs directory. After a crash it imperative to run this file immediately so that the contents of the error log are not overwritten.

copy C:\Foldit\log.txt C:\FolditLogs\%1_error_log.txt

To set up the commands do the following:

Create a file directory C:\FolditLogs.

Create batch files e.bat and o.bat in that directory.

Copy the copy command texts to the appropriate batch files.

To use the commands do the following:

Open the Window file tool and get in the C:\FolditLogs directory.

Open a DOS window and type “e Jul31” to create a file called Jul31_error_log.txt in the C:\FolditLogs directory.

Open a DOS window and type “o puz947Jul31” to create a file called puz947Jul31_couput.txt in the C:\FolditLogs directory.

Versions of this for Macs and Linux systems should appear.

(Thu, 07/31/2014 - 19:43  |  7 comments)


Joined: 07/21/2013
Groups: Beta Folders

I thought I attached the two batch files. I will try again to attach them.

smholst's picture
User offline. Last seen 2 years 18 weeks ago. Offline
Joined: 03/09/2013
Groups: None

e.bat:
@echo off
mkdir C:\FolditLogs
rem copy C:\Foldit\scriptlog* C:\FolditLogs\
copy C:\Foldit\log.txt C:\FolditLogs\%1.log.txt

Joined: 07/21/2013
Groups: Beta Folders

It seems that I can not attach *.bat files. I will rename them as *.txt files and see what happens.
I guess *.bat files are commands, which may be dangerous.

smholst's picture
User offline. Last seen 2 years 18 weeks ago. Offline
Joined: 03/09/2013
Groups: None

using bash:

#!/bin/bash
# FOLDIT has to point to the Foldit-programdirectory. (export FOLDIT=/DIRECTORY)
if test -z "$FOLDIT" ; then echo FOLDIT is not set. ; exit 1 ; fi
test -f ~/FolditLogs || mkdir -p ~/FolditLogs
if test -z "$1" ; then echo Need prefix for the copying. ; exit 1 ; fi
cp %FOLDIT%/log.txt ~/FolditLogs/$1.log
exit 0

spmm's picture
User offline. Last seen 41 weeks 4 days ago. Offline
Joined: 08/05/2010
Groups: Void Crushers

Thanks
I thought there was now a short error file as well as the large log file?
Also if you use named tracks the filename changes. For example: 'scriptlog.951-1.xml' is the name of the log file for one of my puzzle 951 tracks. If you are running the same script in different clients it is, I understand, a good idea to use unique track names.

Joined: 07/21/2013
Groups: Beta Folders

What is the name of the "short error file"?
I check for other files with an .xml file type there were none.

I have never created a track. I created two tracks and made some changes in one of the
tracks. I still had just the scriptlog.default.xml

C:\Foldit>dir *.xml
Volume in drive C is OS
Volume Serial Number is 1C39-7A7F

Directory of C:\Foldit

08/01/2014 11:18 AM 2,447 scriptlog.default.xml
1 File(s) 2,447 bytes
0 Dir(s) 432,303,452,160 bytes free

C:\Foldit>

Could you do the dir *.xml command and send me the output?

I do not run multiple clients. My computer is a little too small for that.

Joined: 07/21/2013
Groups: Beta Folders

Copying recipe output with multiple tracks are used

When running a recipe, using the default track, Foldit creates a file called scriptlog.default.xml,
and over writes the previous contents of this file. A batch file called o.bat will copy the
information to a file in the C:\FolditLogs directory. This batch file should be run immediately
after the script terminates, so that the data will not be overwritten. If more than one track
exists, the recipe output goes to a file with the track name in it. Using the track named wolf,
the recipe output goes to a file called scriptlog.wolf.xml.

A windows batch file named o.bat can be created with the following contents:

copy C:\Foldit\scriptlog.%1.xml C:\FolditLogs\%2_output.txt

If running the default track, use the o.bat file with the following arguments:

C:\FolditLogs>o default puz955_Aug1_size

It will create the following file:

Puz955_Aug1_size.txt

If running in a track called wolf, use the o.bat with the following arguments:

C:\FolditLogs>o wolf puz955_Aug1_w_size

It will create the following file:

Puz955_Aug1_w_size.txt

Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons