A bit more context. There is a bibtex file shared by a collaborator on Dropbox. The file might be frequently modified. I wrote a makefile so that the bibtex file is downloaded every time I compile the tex files. My question is, is it possible to check if the bibtex file has been changed since my last download? If so, I can avoid curl-ing it every time.
PS: I took a look at the dropbox file download header. There is not "Last-Modified" field.
PS2: I'm open to solutions other than Dropbox.
EDIT: Thanks to smarx for the suggestion of using the etag header. FWIW, I'm posting my solution.
// Download the file if the etag doesn't match my record of the previous download
curl -o [OUTPUT_FILE] --header "If-None-Match: cat bib.etag
" https://dl.dropboxusercontent.com/s/[YOUR-LINK]
// Save the new etag
curl -I https://dl.dropboxusercontent.com/s/t62yt1wvj33uxbu/xl_base.bib | grep tag | sed 's/etag: //g' > bib.etag
If you're using the API, you can check whether the rev
field of the file's metadata has changed.
If you're downloading from a direct link (something that starts with dl.dropboxusercontent.com
), I think you'll usually find an ETag
header, but I think that depends on the size of the file.