#!/bin/bash # The following should point to wherever $VSTK_HOME/data is cd /usr/lib/vstk/data # First, clean out very old vdl files. find . -maxdepth 1 -mtime +30 -name 'vfind-*.tar.Z' ######################################################## # This program uses the freely distributable wget, # The options used are as follows: # -A tar.Z only fetch files ending with "tar.Z" # -nd do not make a directory subtree of the site # -nc do not clobber, this means that files # will only be transferred *once* from cyber.com # saving time and bandwidth. # -l 1 Only fetch one level, do not wander around # The web tree # -r Recurse, so any newly-named vdl files are picked # up, provided that they're under the start point. # -q Quiet mode. wget -A tar.Z -nd -nc -l 1 -r -q www.cyber.com/customer/vdl/new/ ############################################################# # List the current tar.Z files by time, get the top one, # and zcat/tar it out. # This is not as efficient as storing state about the # most recently downloaded pieces, or dynamically invoking # zcat and tar only when there are new files, but it's just a 4 # line script. :-) zcat `ls -t *.tar.Z | head -1` | tar -xf -