Choose language

Portal Home > Knowledgebase > How-to > Seedboxes > Other software > megacmd installation


megacmd installation




megacmd is a command-line client for copying files to and from mega.co.nz storage service.

To install megacmd please login to your SSH, here is an article how to do this:

https://www.seedhost.eu/whmcs/knowledgebase.php?action=displayarticle&catid=36&id=54

 

1. Firstly use this command to create ~/bin directory and add it to your PATH:

mkdir -p ~/bin && echo "PATH=\$HOME/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc

2. Now download go compiler required by megacmd installator:

cd && wget -q https://storage.googleapis.com/golang/go1.3.3.linux-amd64.tar.gz

3. Unpack go compiler:

tar xvf go1.3.3.linux-amd64.tar.gz

4. Download megamcd installator with git:

cd && git clone https://github.com/t3rm1n4l/megacmd.git

5. Copy go binaries to the ~/bin:

cp ~/go/bin/* ~/bin/

6. Go to megacmd installator directory:

cd ~/megacmd

7. Install megacmd:

GOROOT=$HOME/go make

8. Copy compiled megacmd binary file to ~/bin:

cp megacmd ~/bin/

 

Done, megacmd has been installed. You can start it by command:

megacmd

 

Usage

Usage megacmd:

megacmd [OPTIONS] list mega:/foo/bar

megacmd [OPTIONS] get mega:/foo/file.txt /tmp/

megacmd [OPTIONS] put /tmp/hello.txt mega:/bar/

megacmd [OPTIONS] delete mega:/foo/bar

megacmd [OPTIONS] mkdir mega:/foo/bar

megacmd [OPTIONS] move mega:/foo/file.txt mega:/bar/foo.txt

megacmd [OPTIONS] sync mega:/foo/ /tmp/foo/

megacmd [OPTIONS] sync /tmp/foo mega:/foo

 

-conf="/home/seedbox/.megacmd.json": Config file path

-force=false: Force hard delete or overwrite

-help=false: Help

-recursive=false: Recursive listing

-skip-error=false: Skip syncing of files that can't be read

-skip-same-size=false: Skip copying of files with same size and path suffix

-verbose=1: Verbose

-version=false: Version

 

 

 

Configuration

Create a file ~/.megacmd.json file with the following command:

nano ~/.megacmd.json

put there the following json:

{
    "User" : "MEGA_USERNAME",
    "Password" : "MEGA_PASSWORD",
    "DownloadWorkers" : 4,
    "UploadWorkers" : 4,
    "SkipSameSize" : true,
    "Verbose" : 1
}


Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Configure XBMC (Views: 11404)
rTorrent startup script (Views: 9019)
cfv installation (Views: 1186)