ark icon indicating copy to clipboard operation
ark copied to clipboard

Ark continues to download file when the file is already present

Open burtlo opened this issue 10 years ago • 4 comments

Ark is always downloading the remote_file, can we not add a new attribute say redownload = true/false, which can then internally check for the existence of the archive and skip downloaded if needed.

burtlo avatar Jul 17 '14 03:07 burtlo

Seeing this too.

maraca avatar Jul 30 '14 00:07 maraca

+1 I would imagine a simple check for if checksum matches, to skip download ... otherwise headache when files being downloaded > 500mb

Brantone avatar Nov 12 '14 21:11 Brantone

The checksum attribute can be used to avoid re-downloading a file when already present on the system. Of course, it requires to specify the expected checksum.

Note that in the past (ark ~0.1), the checksum attribute was providing a security check, which has been lost when ark code switched to Chef remote_file, as reported in #55. https://github.com/devrandom/ark/commit/86bd1fe1bd684147edee50a6ea15c4cf6af7ec95 removed checksum from the documentation, but actually this attribute is still present but with a different behavior:

From https://docs.getchef.com/resource_remote_file.html:

Use to prevent the remote_file resource from re-downloading a file. When the local file matches the checksum, the chef-client will not download it.

I feel that many people get confused with the checksum behavior (even when using remote_file resource) and I wonder if you are also interested to provide again a handful of features:

  • [ ] add redownload attribute (by default set to true). If set to false no more download will be executed when a file is locally present (no checksum verification is applied in this case).
  • [x] checksum attribute is used to avoid unnecessary download effort
  • [ ] raise an error if download file mismatch checksum atttribute

Pending: Define the priority rules between redownload and checksum (e.g. what to do when redownload == false && checkum != nil)

@burtlo interested to align all that?

gildegoma avatar Nov 14 '14 16:11 gildegoma

I read this before writing #201... but after writing #201 I think maybe some relation?

qubitrenegade avatar Nov 23 '17 09:11 qubitrenegade