Ho bisogno che i file vengano scaricati in /tmp/cron_test/. Il mio codice wget è
wget --random-wait -r -p -nd -e robots=off -A".pdf" -U mozilla http://math.stanford.edu/undergrad/
Quindi c'è qualche parametro per specificare la directory?
Dalla pagina del manuale:
-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).
Quindi devi aggiungere -P /tmp/cron_test/
(forma breve) o --directory-prefix=/tmp/cron_test/
(forma lunga) al tuo comando. Nota anche che se la directory non esiste verrà creata.
-O è l'opzione per specificare il percorso del file che volete scaricare.
wget <file.ext> -O /path/to/folder/file.ext
-P è il prefisso dove scaricherà il file nella directory
wget <file.ext> -P /path/to/folder