/[qa]/trunk/pts/www/bin/update_incoming.sh
ViewVC logotype

Diff of /trunk/pts/www/bin/update_incoming.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1899 by hertzog, Sun Jun 15 14:39:42 2008 UTC revision 1900 by hertzog, Sun Jun 15 15:00:21 2008 UTC
# Line 22  fi Line 22  fi
22  cd $root/incoming  cd $root/incoming
23    
24  nice_wget() {  nice_wget() {
     local failed  
     failed=""  
25      # $1: url      # $1: url
26      # $2: filename      # $2: filename
27      # For timestamping to work, copy to .new (not link, wget will not break      # For timestamping to work, copy to .new (not link, wget will not break
28      # the link)      # the link)
29      cp -a $2 $2.new || true      cp -a $2 $2.new || true
30      # Beware that -N conflicts with -O (#88176, #202911)      # Beware that -N conflicts with -O (#88176, #202911)
31      wget -U pts -q -O $2.new $1 || { failed=1; }      if wget -U pts -q -O $2.new $1 ; then
32      if [ "$failed" = "1" ]; then          mv $2.new $2
33        else
34          echo "Downloading $1 failed, $2 is stale now"          echo "Downloading $1 failed, $2 is stale now"
35          rm -f $2.new          rm -f $2.new
     else  
         mv $2.new $2  
36      fi      fi
37  }  }
38    

Legend:
Removed from v.1899  
changed lines
  Added in v.1900

  ViewVC Help
Powered by ViewVC 1.1.5