I have my laptop, most of the time connected to internet, the speed of internet is quite slow. When i download some big files, then i am not able to surf web sites because of slow speed of internet. My plan is to write a bash script and run it in cron jobs, when it finds the system is idle then it starts a process(the process which will download the big files preferably wget) automatically and when i use the laptop then the process is killed. Similar to a screensaver( I have found some ways at http://stackoverflow.com/questions/622367/scheduling-in-linux-run-a-task-when-computer-is-idle-no-user-input but i dont use screensaver on my machine neither i want to depend on gnome application like xscreensaver ). I use Ubuntu linux, is there a way to find proper idle time of a Linux mahine.
idle = no keyboard, touch pad or mouse clicks.
Is there some way to find network activity in such way, like if their is no internet traffic then my sript start executing another wget script and if my browser request for web pages then it will stop executing the script.
please suggest me a proper way.. should i implement it using idle time, it will be more effective if i use network traffic into consideration.