A Script That is Aware of Remote File Change

0

curl -z pci.ids --remote-time --silent -f -L -O \ http://pciids.sourceforge.net/v2.2/pci.ids

This command checks if the remote file changed and downloads only if the remote file has been modified. How can I make it display "Changed" only if the file has changed?

The KingMaker

Posted 2013-11-13T04:09:41.270

Reputation: 103

Should be on stackoverflow – Jon – 2013-11-13T04:16:21.857

Answers

1

Curl, wget and a few others use the "last modified" date. The "last modified" date in http doesn't necessarily correspond to anything on the physical file. You will need to download the file and check to see if it's changed.

Back2Basics

Posted 2013-11-13T04:09:41.270

Reputation: 166