Jump to content
Ketarin forum

Check for updates only 2


Recommended Posts

Guest easteregg

Hi!

How do I check a static file link for updates only without downloading? (Headers file size, last modified, e-tag, etc. are present.)

If I check 'Do not download, check for updates only' Ketarin always reports an update. If I additionally check 'Ignore file information (do not re-download if file is missing)' Ketarin never reports an update. So what am I missing?

Link to post
Share on other sites

If you don't have a physical file to compare to and 'check for updates only' is enabled then it will check the size, last modified and e-tag against the record data from the last downloaded file. It will not *update* the information it compares against unless it performs a download.

There is a way to work around this and update the stored reference information if you want to manage the downloads externally or don't want to actually download the files at all. This is done by returning exit code 3 in the Before Update command. This is ridiculously easy - you just have to add "exit 3" to the end of the script 'execute the following command before downloading' on the Commands tab.

If you're using this to monitor something and want to automate it externally you can use this script to push the new file information to a file, send an email, or anything else you can do with the command line or powershell. Just make sure "exit 3" is the last line. 

Link to post
Share on other sites
Guest easteregg

Sorry for the new topic, but how can I answer my own topic, here?

Quote

If you don't have a physical file to compare to and 'check for updates only' is enabled then it will check the size, last modified and e-tag against the record data from the last downloaded file. It will not *update* the information it compares against unless it performs a download.

There is a way to work around this and update the stored reference information if you want to manage the downloads externally or don't want to actually download the files at all. This is done by returning exit code 3 in the Before Update command. This is ridiculously easy - you just have to add "exit 3" to the end of the script 'execute the following command before downloading' on the Commands tab.

If you're using this to monitor something and want to automate it externally you can use this script to push the new file information to a file, send an email, or anything else you can do with the command line or powershell. Just make sure "exit 3" is the last line. 

Thanks, but this doesn't seem to work: In accordance with the wiki, using 'exit 3' only updates 'LastUpdated', i.e. the time when I pressed the update button. It doesn't give me any  information about the file itself. So there is no way of monitoring files without downloading or having a local copy? Can I access somehow the headers of the file in Ketarin and save them in a variable to use them?

Link to post
Share on other sites
Guest easteregg

Just in case anyone is interested in it:

I solved this by declaring 2 text variables: The first one defines a PowerShell script using Invoke-WebRequest to obtain the headers. The second one actually runs the script and is used as the indicator for changes. So no file download or local copy is needed.

If someone knows a more elegant solution, please post it!

Maybe it's possible to merge the 3 parts of this topic. Sorry for being to dumb to post them as one.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.