Changes between Version 8 and Version 9 of AlternateDistributionClient
- Timestamp:
- Aug 12, 2009, 11:38:23 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AlternateDistributionClient
v8 v9 1 1 = An Alternate Data Distribution Client = 2 2 3 update_mirror.pyis a simple client for the IPP distribution system. It requires only Python 2.6 to run; the IPP software need not be installed. The script understands the IPP distribution system communication protocol and is intended to be run from ''cron'' to implement daily updates of a mirror site.3 ''update_mirror.py'' is a simple client for the IPP distribution system. It requires only Python 2.6 to run; the IPP software need not be installed. The script understands the IPP distribution system communication protocol and is intended to be run from ''cron'' to implement daily updates of a mirror site. 4 4 5 5 The advantages of the script are simplicity, brevity, ease of installation and ease of operation. Potential disadvantages are: … … 10 10 == Installation Instructions == 11 11 12 1. Create an empty directory on the filesystem where you want to mirror the data distribution. On Odyssey the corresponding directory is /n/panstarrs/data/MIRROR . 12 1. Create an empty directory on the filesystem where you want to mirror the data distribution. On Odyssey the corresponding directory is /n/panstarrs/data/MIRROR . The source files are attached below. 13 13 1. Copy update_mirror.py and parse_config.py into that directory. 14 14 1. Customize update_mirror.py for your site, by editing the variables at the top of the file and making the following changes: … … 32 32 }}} 33 33 34 == Mode of Operation == 35 36 The distribution system provides a list of products; new data is appended to those products over time. The client must remember the most recent update time for a product and only download new material posted since that time. It must also keep track of previously failed downloads so that they can be re-tried later. 37 38 ''update_mirror.py'' stores its status information in two comma-separated-value files, the default names for which are ''product_status.csv'' and ''download_failures.csv''. It maintains a log called ''update_mirror.log'' by default. If it is interrupted it will also save the state of its internal queues in a file called ''update_mirror_leftover_work.pkl'' so that it can pick up where it left off when it is restarted. When it starts up, it: 39 40 1. Re-queues leftover work from a previous crash, if any. 41 1. Re-queues any entries from the download failures file. 42 1. Checks for updates to desired products which are more recent than the times recorded in the product_status.csv file, and adds those filesets to the download queue. 43 1. Commences to work through the download queues using multiple instances of wget and tar, as specified by the IPP distribution protocol. 44 45 When it finishes working through the queue it updates its status files and exits. '''Note: if you try to kill it with SIGTERM (the normal kill signal) it will finish processing the currently in-progress filesets before quitting. This can take a while, but it's worth it in terms of cleanup.''' If you need to stop it immediately kill it with SIGKILL (''kill -9''). You are then responsible for cleanup. 46
