This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Previous Topic

Up

Releasing file locks

If a problem arises with an installed copy of Snap WebHost, it may be due to a file lock problem.

Because multiple respondents can complete surveys simultaneously, while at the same time the researcher chooses to suspend the survey, a file-locking system is in operation. If there is a communication glitch while a file is locked, it is possible for the file to remain locked, and will remain locked even after Snap WebHost has been rebooted.

To solve this problem, you must stop the Snap WebHost services. You may then delete the file locks by using the file roc.pyc. with the -z (or --zaplocks) option. Only use this option if the Snap WebHost services have been suspended.

  1. Stop the Snap services as described in Stopping Snap WebHost.
  2. Run:

    roc.pyc -z

    This deletes all the file lock directories (filestats.cache_) from the directory tree below the survey directory of the root user. If you wish to use another path type:

    roc.pyc -zr [start_directory]

    (E.g. roc.pyc -zr C:\webhost\surveys)

roc.pyc

Option

Default

Meaning

-h
--help

 

Show this help message and exit

-l ENTS
--numentries=ENTS

10

The number of entries to copy from the end of each survey's 'log.txt' file.

-n NUM
--numsurveys=NUM

10

The number of recent surveys to scan. These are counted from the most recently accessed to the least recently accessed.

-p PREFIX
--prefix=PREFIX

ROC_output

Set the report filename prefix. Report filenames are in the form PREFIX_<date>_<time>.txt'

-r ROOTDIR
--surveyroot=ROOTDIR

the root users survey directory

The survey root directory. This is normally the survey path set in the Edit Researcher page of the root user. If roc.pyc is not being run by the root user, then it should be that user's researcher survey path. If the survey root directory cannot be found, it will default to C:\SnapWebHost\Surveys

--version

 

Show program's version number and exit

-z
--zaplocks

 

Deletes the locking directories 'filestats.cache_' (and their children).

Only use this option if the Snap WebHost services have been stopped.

Examples

roc.pyc

Creates a ROC_output_date_time.txt file in the current working directory. This file contains the last 10 entries from the log files of the ten most recently accessed surveys in the directory tree beneath the survey path directory of the root user

roc.pyc -z

Deletes all the locking directories beneath the survey path directory of the root user, and creates a ROC_output_date_time.txt file in the current working directory. Only use if Snap WebHost has been stopped.

roc.pyc -n15-rmyDir

Creates a ROC_output_date_time.txt file in the current working directory. This file contains the last 10 entries from the log files of the 15 most recently accessed surveys in the directory tree beneath myDir.

Previous Topic