[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] HTTP Last-Modified
From: |
MrBiTS |
Subject: |
Re: [shell-script] HTTP Last-Modified |
Date: |
Sun, 25 May 2008 19:59:30 -0300 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080505) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
| E eu PRECISO saber o TS desses diretorios de nivel acima, para saber em
| qual deles entrar, e entao sim, vasculha-lo em busca do arquivo mais novo.
|
| Repito: o problema eh o timestamp do DIRETORIO.
|
| Alguma sugestao?
O Tiago deu uma sugestão muito boa, utilizando a opção --mirror. Entretanto,
ela fai fazer um mirror do site como um todo,
utilizando recursividade.
Você pode tentar o wget --timestamping, que habilita a opção de verificação de
TS dos arquivos que você quer baixar. Lembre-se que
diretório nada mais é do que um tipo especial de arquivo.
Veja uns testes:
a) Trazendo o arquivo:
$ wget --timestamping http://www.mrbits.com.br/css/mrbits.css
- --19:48:44-- http://www.mrbits.com.br/css/mrbits.css
~ => `mrbits.css'
Resolving www.mrbits.com.br... 200.142.76.4
Connecting to www.mrbits.com.br|200.142.76.4|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3,923 (3.8K) [text/css]
100%[================================================================================================================>]
3,923
~ --.--K/s
19:48:45 (73.00 KB/s) - `mrbits.css' saved [3923/3923]
b) Tentando trazê-lo novamente, sem verificação
$ wget --timestamping http://www.mrbits.com.br/css/mrbits.css
- --19:48:47-- http://www.mrbits.com.br/css/mrbits.css
~ => `mrbits.css'
Resolving www.mrbits.com.br... 200.142.76.4
Connecting to www.mrbits.com.br|200.142.76.4|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3,923 (3.8K) [text/css]
Server file no newer than local file `mrbits.css' -- not retrieving.
c) Depois de modificá-lo, trazemos novamente
$ wget --timestamping http://www.mrbits.com.br/css/mrbits.css
- --19:49:35-- http://www.mrbits.com.br/css/mrbits.css
~ => `mrbits.css'
Resolving www.mrbits.com.br... 200.142.76.4
Connecting to www.mrbits.com.br|200.142.76.4|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3,924 (3.8K) [text/css]
Remote file is newer, retrieving.
- --19:49:35-- http://www.mrbits.com.br/css/mrbits.css
~ => `mrbits.css'
Reusing existing connection to www.mrbits.com.br:80.
HTTP request sent, awaiting response... 200 OK
Length: 3,924 (3.8K) [text/css]
100%[================================================================================================================>]
3,924
~ --.--K/s
19:49:35 (121.49 KB/s) - `mrbits.css' saved [3924/3924]
Você não vai ter grandes dificuldades em adaptar o wget à sua necessidade.
Outra alternativa interessante é o zsync ( http://zsync.moria.org.uk/ ) que
possui a mesma filosofia do rsync, utilizando HTTP como
transporte.
- --
Um abraço
.0. MrBiTs - address@hidden
..0 GnuPG -
http://keys.cardboard.net:11371/pks/lookup?op=get&search=0xAC37715A6DD1F186
000 http://www.mrbits.com.br
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIOe9SrDdxWm3R8YYRAtOpAJ46pw9pB5T4qCE976efu9dWdBF/fwCeMcuG
XG/rh7to+ItLa1GOBOsLL2g=
=+A7X
-----END PGP SIGNATURE-----