Last Update: Friday, 16-Mar-2007 13:54:18 EDT by Bill Wyatt
Various options affect the transmission and eventual archiving of the data file.
The queue name is settable by the sysadmin, but we're using archive currently. In general, the form of the command is:
lp -d archive [-o <keyword=value>] filename
as with any printer command. The lpstat -o archive command will show any files queued but not yet transmitted.
At the other end of the link, here called the ``archive site'', one or more ``lpsweeper'' processes copy the files from the ftp incoming directory to their instrument-specific destination.
All the options except those below beginning with "rem" (i.e., remhost, etc.) are put into the control file sent to the archive site for possible use by the sweeper programs.
- instrument or inst Default: inst=undef
- Sets the instrument name, e.g. inst=minicam. This selects which archive will receive the data back in Cambridge. The default is settable by the sysadmin.
- maxftp Default: maxftp=600
- Sometimes, due to network problems, the ftp session simply hangs with no exit status. To prevent indefinite timeouts, the interface script will allow the ftp session to last this number of seconds (per file) before deciding to abort and issue an error. Setting maxftp=0 is equivalent to an infinite amount of time.
- dir Default: <none>
- This is passed on to the remote side as a hint about which directory this file should be archived to. See the lpsweeper documentation.
- remhost Default: remhost=tdc-ftp.harvard.edu
- Sets the host to transmit the data to. Should not be changed under normal circumstances.
- rempath Default: rempath=/incoming
- Sets the directory to put the data into. Should not be changed under normal circumstances.
- remuser Default: remuser=tdcin
- Sets the remote user ftp account. Should not be changed under normal circumstances.
- rempw Default: rempw=********
- Sets the password of the remote ftp account. Actually, this is a restricted ftp guest account, and is pretty well protected, so announcing the password ought not to be a problem. Should not be changed under normal circumstances.
lpsweeper, instructed by command line arguments, takes all files of a given instrument, checks their validity, then moves them to a destination directory, timestamping it to agree with the creation time of the source file at the instrument end. There is also an option to sweep out all files that are not of a recognized instrument, moving these to a miscellaneous directory. This keeps the ftp incoming directory and partition free to accept more data.
The expected use of lpsweeper is to be run from a crontab set up by each instrument, at reasonable intervals such as 10 minutes.
- -i instrument Default: <none>
- Tells lpsweeper to look for files from the instrument named instrument. There is no default for this argument; lpsweeper will abort if an instrument name is not supplied.
- -d instdir Default: <none>
- Tells lpsweeper to put files from the instrument into the directory instdir, or a dated directory under it. There is no default for this argument; lpsweeper will abort if an instrument directory is not supplied.
- -L logdir Default: instdir/xferlogs
- Use this path as the directory for writing log files. A new logfile for each day is generated, unless an explicit logfile is given. If this path does not start from root, the current working directory is prepended to it. The default log directory is instdir/xferlogs.
- -l logfile Default: YYYYMMDD.tdcin.log
- Use this file to hold the logging information instead of making one up based on the current date. If this is a path from root, the logdir option is ignored; otherwise the full path is logdir/logfile. The default logfile name is of the form YYYYMMDD.tdcin.log, where the date part is the UTC time of the lpsweeper execution.
- -f input-directory Default: /data/mc4/tdc-ftp/incoming
- Directory to scan for input files. Default is /data/mc4/tdc-ftp/incoming. This would normally only be changed to sweep files out of a ``miscellaneous'' directory (see the -A option, below).
- -o options
- This supplies options of the form optname=value for processing exactly as if supplied by the original lp command on the instrument computer. Not all options are processed, however. Those that are:
- dir=dirname
- Supplies a directory under which to store the files instead of a directory derived from the original path or the queuing time.
- -D
- Store files under a dated subdirectory (see Operation). This is the default.
- +D
- Do not store files under a dated subdirectory (see Operation).
- -A
- Sweep ``ANY'' files not known to be instrument files. With this option, there is a default destination directory, currently /data/mc4/wyatt/lparchive. In this case only, both the control file and the data file are copied unchanged to the destination, so that it will be possible to later run lpsweeper on the destination to move the files to their correct destination.
This option should only be used by one agreed-upon user, or unaffiliated files may get lost as they would wind up in different miscellaneous directories depending on which sweep ran at the time the file was in the incoming directory. Currently, I (Bill Wyatt) am running lpsweeper -A once per day at 1802 hours ET, and putting the unaffiliated files into dated directories under:
/data/oirperm/wyatt/lparchive/ANY
- -n ignore-list-additions
- Add one or more names to a list of instruments to be ignored by the -A mode, above. The list can be comma-separated or by whitespace if enclosed in quotes. See ignore-list for the default list.
- +n ignore-list
- This options replaces the default option list with that on the command line. The current default list of instruments to ignore is:
minicam megacam hectospec hectochelle fast ircam afoe 4shooterDangerous. Maybe too much so to be useful.
Example 1, run as user mcam:lpsweeper -i minicam -d /data/mc4/mcam/archive/rawdata/data/ARCHMINICAMThis would be a typical command an instrument crontab could execute every 10 or 15 minutes to move its files out of the FTP directory. If, for example, the files were originally in directory /h/ftphome/ARCHMINICAM/2002.0523 at the MMTO, then they wind up in Cambridge under /data/mc4/mcam/archive/rawdata/data/ARCHMINICAM/2002.0523.Example 2, run as user wyatt:
lpsweeper -A -n wyatt -d /data/mc4/wyatt/lparchiveSweep all files, including control files, and excepting the defaults and those identified as ``wyatt'', into /data/mc4/wyatt/lparchive/YYYY.MMDD. The transfer log will be /data/mc4/wyatt/misc/xferlogs.
Example 3, run as user wyatt:
lpsweeper -i wyatt +D -d $HOME/lparchive -l $HOME/lplogsSweep any files for ``wyatt'', putting them without dated subdirectories, in /home/wyatt/lparchive and the transfer log data into file /home/wyatt/lplogs.