Man reikia, kad failai būtų atsisiunčiami į /tmp/cron_test/. Mano wget kodas yra
wget --random-wait -r -p -nd -e robots=off -A".pdf" -U mozilla http://math.stanford.edu/undergrad/
Taigi, ar yra koks nors parametras, nurodantis katalogą?
Iš vadovo puslapio:
-P prefix
--directory-prefix=prefix
Set directory prefix to prefix. The directory prefix is the
directory where all other files and sub-directories will be
saved to, i.e. the top of the retrieval tree. The default
is . (the current directory).
Taigi į komandą reikia įrašyti -P /tmp/cron_test/
(trumpoji forma) arba --directory-prefix=/tmp/cron_test/
(ilgoji forma). Taip pat atkreipkite dėmesį, kad jei katalogas neegzistuoja, jis bus sukurtas.
-O - tai parinktis, kuria galima nurodyti failo, į kurį norite atsisiųsti, kelią.
wget <file.ext> -O /path/to/folder/file.ext
-P yra priešdėlis, į kurį bus atsisiųstas failas kataloge
wget <file.ext> -P /path/to/folder