I have a script (actually, a Rails application with a Sidekiq job queue system), which uploads pictures and albums to Flickr. This data is huge for my purposes (around 100GB), and the upload is slow due to my low internet speed.
I have already configured the script to run when Ubuntu boots, as well as have
init.d interface for controlling this script.
Now, since the uploading consumes all my bandwidth, I want to run this script only when the internet connection is idle, i.e. the script should pause automatically when the internet connection is being used by other applications, and resume once it becomes idle again.
So, I would like to know if there is a way that I can monitor my internet connection and check to see if other applications are connected online. If so, the script pauses itself, and resumes when the connection becomes idle again.
Any pointers or help in this regard is appreciated.