john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Wget script

!/bin/sh

wget -S -r ftp://USER:PASS@192.168.1.20/directory/*

wget -S -r /madics ftp://USER:PASS@192.168.1.20/madics/*

wget -S --preserve-permissions -P /madics ftp://USER:PASS@192.168.1.20/madics/*

-S preserve original timestamps -P or --directory-prefix is the "directory prefix", not the destination directory, because of the -r "recursive" option

wget -r -S --preserve-permissions -P /madics ftp://USER:PASS@192.168.1.20/madics/*

crontab -l
crontab -e

0 1 * * * /madics-backup.sh

wget -r -l1 http://192.168.2.1:8080/dist/win/ -P /home/ubuntu/archives/

recursive 1 level and saves to the "prefix" directory (instead of .)


!/bin/bash

TIMESTAMP=/bin/date +%Y-%m-%d--%H-%M TARGET="/home/ubuntu/pfeifferwinbuilds"

if [ -d $TARGET ]; then

echo "$TIMESTAMP start downloading... "
wget --user=USERNAME --password=PASS http://192.168.2.1:8080/win/application.exe -P $TARGET && mkdir "$TARGET/$TIMESTAMP" && mv "$TARGET/application.exe" "$TARGET/$TIMESTAMP/application.exe"
echo "done downloading"

else echo "directory not found" fi


GNU WGET has zips of the binaries and dependencies, this example is to download from a hudson build server

c:\wget\wget.exe --auth-no-challenge --user=USERNAME --password=PASSWORD http://HUDSONSERVERIPADDRESS:8080/view/clients/job/projectname/lastSuccessfulBuild/artifact/output/INSTALLER.exe


  • « installshield windows silent unattended installation
  • rsa encryption in c continued »

Published

Aug 12, 2011

Category

linux

~124 words

Tags

  • linux 249
  • script 19
  • wget 7