I do something like
wget --user=userName --password=passWord --timestamping https://url.to/a/file.csv.gz
gzip -cd file.csv.gz > file.csv
(not tested)
Please note that the server requires authentication.
The file will only be downloaded, if it’s newer than the local file. This is good.
However, also line 2 should only be executed if the remote file is newer than the local file.
How can I do that?
Just test to see if the modification time of the
file.csv.gzis newer than thefile.csv.On Linux:
On BSD (like Mac OS X):
Other systems may have different arguments to
stat; checkman staton your system, orhelp statif it’s a shell builtin.