Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When downloading big files it necessary to pause the download many times. A big file can be downloaded by using wget. First start download, then kill wget, then resume download by wget -c.
I want to pause downloads too many times depending on events such as power failure, Network unavailability, etc... and want to automate it using a script. So pressing Ctrl+C is't an option. I know a process can be paused by kill -STOP "$pid" The pausing should not close the connection to the website, either it should wait for resume command or the bandwidth throttled to very low use.

I found these commands using aria2c in, but I can't use it successfully. This uses RPC method. Can I use it in a script?

This method pauses the download denoted by gid. gid is of type string. The status of paused download becomes paused. If the download is active, the download is placed on the first position of waiting queue. As long as the status is paused, the download is not started. To change status to waiting, use aria2.unpause() method. This method returns GID of paused download.


This method changes the status of the download denoted by gid from paused to waiting. This makes the download eligible to restart. gid is of type string. This method returns GID of unpaused download.


  1. How to pause (or throttle bandwidth) an already running download of aria
  2. Is there a better down loader than aria to use in script
  3. Wether RPC method can be used in script
share|improve this question
up vote 6 down vote accepted

For this to work your aria2 should support option pause. Search for --pause[=true|false] in man aria2c. It works in aria2_1.12.0-1_i386 [oneric] (and later).

First start RPC server: aria2c --enable-rpc=true (For older ver. aria2c --enable-xml-rpc=true)
Then use RPC using http://localhost:6800/jsonrpc
The following example adds to aria2: In a python console type the following


import urllib2, json
jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)

The following example pause download whose GID is "3":


import xmlrpclib
s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')

If you get somethin like below your version of aria2 doesn't support it.

xmlrpclib.Fault: <Fault 1: 'No such method: aria2.pause'

In version that use aria2c --enable-xml-rpc=true, other options can be used such as adiing files, etc. (using XML RPC).

share|improve this answer
Works on Ubuntu 12.10 but not on 10.04 (option pasue not available) – totti Mar 27 '13 at 10:40

Simplest you can use Ctrl + C shortcut in terminal/konsole to pause the download. Internally it makes a temporary file in the same directory of extension .aria2, and when you try to redownload the file, it starts from the position it was made to pause. And don't use Ctrl + Z.

share|improve this answer
True, but can't use in a script. (about Ctrl + C already mentioed in line 5 of the question) – Prinz Mar 25 '13 at 10:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.