Search code examples
linuxamazon-web-servicesdownloadwgetubuntu-server

How to check which file wget is downloading while script is working in background?


I have a script running on an AWS Ubuntu Server. The script simply downloads a file to disk, syncs it to S3 storage and deletes the file from disk. I included a simple progress tracker that reports for example "url 1 of 100 downloaded". In hindsight, I should have included progress information such as "ftp://some_path/some_file.laz: url 1 of 100 downloading".

The script seems to either be 1) hung or 2) downloading a massive file, since the number of downloaded files has not changed in 12 hrs. How can I check which url is being downloaded by an active script? Alternatively, how can I check if the script is still downloading or just hung?


Solution

  • ps command will tell you if it's still running or if it has crashed.

    ls -alt in the download directory should show you the downloaded files in order of modification date. That should allow you to see what the last updated file was. If you then proceed to run that command a few more times you should be able to see if the size of that file is changing over time (i.e. download is in progress).