Skip to content
kweekly edited this page Jul 27, 2012 · 1 revision

This page lists the tools available in the bin/ directory. If you have your SENSEZILLA_DIR, SENSEZILLA_MISSION and PATH environment variables set correctly, these programs should be able to be run in the command window when you log into the server.

Most of the programs should provide some help or usage text if started without arguments.

User Tools

run_flow.py

Usage: run_flow.py [list | run]
    
    list : List available flows to run
    
    run <flow name> [--from <from time>] [--to <to time>] [--pretend] [--nocache] [--local] [<source name> <device identifier>] 
        Run the given flow.  Optional time interval, default is past day.
        Optional source name and device identifier, default is all known devices.
        --pretend is for testing, doesn't actually add the tasks to the task manager
        --nocache redoes all of the steps instead of looking for cached steps
        --local makes no connections to the postgres database and manually runs the tasks, dumping the output in the current directory
            you must specify sourcename and device identifier

Used to run flows on the given source and identifier. If flow name ends in '.flow', the program looks for the file directly, otherwise, it looks for ".flow" in the "flows/" directory.

fetcher.py

Usage: fetcher.py [list | fetch]

    list : List available sources and identifiers        

    fetch [--from <time>] [--to <time>] <source name> <device identifier> <output CSV>
        Fetch data to CSV, default 1 day history, or by given times

Used to fetch a CSV file from the given source_name/source_id pair for the given timespan.

csv_merge.pl

Usage: csv_merge.pl <from time> <to time> <output CSV> <input CSV files .... >

Efficient tool to read several input CSV files and select a range of data from them. Data which is not provided by any input CSV file is left out. If the input CSV files overlap, then only one data point will be provided for each time point. All times, on the command line and in the first column of the CSV, must be numeric and directly comparable.

csv_bounds.pl

Usage: csv_bounds.pl <input CSV file> <tscale>
Returns: --from <min time> --to <max time>
Suitable for use with run_flow.py and fetcher.py
e.g. fetcher.py fetch `csv_bounds.pl asdf.csv` ...
Optionally timescale the from and to arguments

Useful for running flows on entire CSV files. All times, on the command line and in the first column of the CSV, must be numeric and directly comparable.

Administration

exe

Usage: exe list           : List processes running and their status
    exe start   <proc> : Start given process
    exe stop    <proc> : Stop given process
    exe restart <proc> : Restart given process
    exe state   <proc> : Get state of process
    exe kill           : Kill mod_exec and all processes

Used to perform various operations on the python modules. A normal user should have to use this at all.

flush_errors.py

Usage: flush_errors.py [tasks | files | flows | all] [--autoconfirm]
    
    tasks : Flush crashed and timed-out tasks from database. Propagate to tasks which depend on them
    
    files : Flush FAIL files from database and files which depend on missing tasks.
    
    flows : Flush flows which cannot complete due to FAIL'd or missing files, or composed of crashed or missing tasks.
    
    all : Do all three in that order

Flushes any crashed tasks and any files or flows that depend on crashed tasks from the database. This is mostly used to get rid of the extra junk hanging around from previous failed attempts.

Clone this wiki locally