Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i would like to download a file from dropbox every hour and log it for testing. whats the best way to this?

im new to wget and so far iv manage to download the file. here is what i have so far:

wget -o download.txt --no-check-cert LINK

could anyone give me any advice on how to this? will the download.txt file be overwritten everytime it redownloads?

thanks

share|improve this question
3  
Which operating system? –  Daniel Andersson Mar 8 '13 at 16:52
    
If you are using linux, try crontab –  agz Mar 8 '13 at 16:56

1 Answer 1

wget --help says

  -o,  --output-file=FILE    log messages to FILE.
  -a,  --append-output=FILE  append messages to FILE.
  -d,  --debug               print lots of debugging information.
  -q,  --quiet               quiet (no output).
  -v,  --verbose             be verbose (this is the default).
  -nv, --no-verbose          turn off verboseness, without being quiet.
...
  -O,  --output-document=FILE    write documents to FILE.

so you have to use the -a switch to append to the log file instead of overwriting it.

To make Wget produce more or less verbose output, you can use the switches -d and -nv, respectively. -O nul discards the downloaded file.

Example:

wget -O nul -nv -a log.txt --no-check-cert dropbox.com/s/auhouuxtpav6mo4/Boston%20City%20Flow.jpg

To do this once per hour, you can use this batch file:

@echo off
:start
wget -O nul -nv -a log.txt --no-check-cert dropbox.com/s/auhouuxtpav6mo4/Boston%20City%20Flow.jpg
choice /C y /D y /T 3600 > nul
goto start

The choice command is a (hacky) way to delay the next command for an hour.

If you want to run the batch script in the background, you can use Bat To Exe Converter and choose Invisible application.

share|improve this answer
    
sorry the download.txt is where the log is going to be saved. i would like to download the file every hour and log it, im trying it on windows but may be able to try in ubuntu. below is the file im trying to download wget -O download.jpg --no-check-cert dropbox.com/s/a uhouuxtpav6mo4/Boston%20City%20Flow.jpg –  user205403 Mar 8 '13 at 17:19
    
Ah, OK. Do you need the file as well? –  Dennis Mar 8 '13 at 17:27
    
no just to show that they've been downloaded. so i dont mind if they are deleted. –  user205403 Mar 8 '13 at 17:54
    
I've edit my answer. –  Dennis Mar 8 '13 at 18:04
    
Is there a restriction with regards to repeating the process? Why not use Task Scheduler instead of choice? –  Karan Mar 10 '13 at 0:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.