0

When I need download some large files from other countries, I often download them onto a VPS in USA, and then download them from there to my home, since it is too slow to download directly from my country.

The link from VPS to my home is slow, so that I use multi-threads downloading tool such as Axel when I am fetching the files from VPS to my home. But Axel will modify the timestamp of files, I can not preserve the original timestamp same as the web server hosting files.

For example: I use Wget to download a ISO from ubuntu.com to my VPS in USA. On the VPS, the timestamp is same as the original. I know that SCP command also can carry the timestamp of the source files with option "-p", but scp is slower than axel. I want to use axel download the content of files.

Is there a way, in it we can fix the timestamp after we downloaded files? Just only copy the timestamp of files as if they was downloaded with "scp -p " or wget.

thanks!

4
  • 1
    A workaround may be to archive the files on the remote side, so the timestamps are stored inside the resulting archive. Download it by any method and unpack. You may find this interesting: tar - How to preserve timestamps down to more than a second of precision? Commented Feb 26, 2019 at 17:18
  • thanks! But it is time-costly to tar large files?
    – Leon
    Commented Feb 26, 2019 at 17:32
  • It takes some time. But if your connection to the VPS is slow compared to how fast the VPS can tar (and how fast your local machine can untar), It may not add that much overall. Another problem may be it needs additional disk space, at least temporarily. Only you can evaluate if this approach is useful for you. Commented Feb 26, 2019 at 17:38
  • As an answer suggests, you should consider rsync, it is the correct tool for this job. However, it may not always be easy to use it. If you want, you can use Wget2, the next version of Wget for your usecase. It is almost ready and supports threaded downloads.
    – darnir
    Commented Feb 26, 2019 at 19:51

1 Answer 1

1

It might be worthwhile to look into rsync, a tool designed to make sure source and destination files/folders are identical. If you run rsync on a file that already has the same content, it fixes only the time stamp.

As a nice side effect, if you run rsync on a file or folder that is "almost" identical it will only transfer the differences, saving time and bandwidth.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .