Giter Club home page Giter Club logo

megacmd's Introduction

MEGAcmd - Command Line Interactive and Scriptable Application

MEGAcmd provides non UI access to MEGA services. It intends to offer all the functionality with your MEGA account via commands. It features synchronization , backup of local folders into your MEGA account and a webdav/streaming server.

See Usage Examples.

Available packages for MEGAcmd in all supported platforms should be found here. If the package fails to install, read below for the requirements.

It supports 2 modes of interaction:

  • Interactive - A shell to query your actions
  • Scriptable - A way to execute commands from a shell/a script/another program

In order to provide those 2 modes, it features one server (MEGAcmdServer), an interactive shell (MEGAcmdShell) and several commands that will launch the non-interactive client (MEGAcmdClient).

See Usage and Platform to understand how to use it in your particular system.

Building MEGAcmd

If you wish to build or install MEGAcmd, here are a list of requirements and instructions.

Requirements

The requirements are the same as those for the sdk (usually cryptopp, zlib, sqlite3, cares, libuv, ssl, curl, sodium, readline for platforms other than Windows. It is recommended to include pcre to have support for regular expressions.

In order to have support for thumbnails and previews, it is highly recommended to have ffmpeg (libavcodec-dev libavutil-dev libavformat-dev libswscale-dev) and mediainfo(libmediainfo-dev + libzen-dev) for media file attributes.

For convenience, here is a list of packages for common Linux Distros and precompiled third party dependencies for other Operative Systems:

  • Ubuntu 16.04

    • autoconf libtool g++ libcrypto++-dev libz-dev libsqlite3-dev libssl-dev libcurl4-openssl-dev libreadline-dev libpcre++-dev libsodium-dev libc-ares-dev libfreeimage-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libmediainfo-dev libzen-dev
  • Ubuntu 18.04

    • autoconf libtool g++ libcrypto++-dev libz-dev libsqlite3-dev libssl-dev libcurl4-gnutls-dev libreadline-dev libpcre++-dev libsodium-dev libc-ares-dev libfreeimage-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libmediainfo-dev libzen-dev libuv1-dev
  • Debian 9

    • libcrypto++ libpcrecpp0v5 libc-ares-dev zlib1g-dev libuv1 libssl-dev libsodium-dev readline-common sqlite3 curl autoconf libtool g++ libcrypto++-dev libz-dev libsqlite3-dev libssl-dev libcurl4-gnutls-dev libreadline-dev libpcre++-dev libsodium-dev libc-ares-dev libfreeimage-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libmediainfo-dev libzen-dev
    • In some instanances you may need to run apt install --reinstall build-essential
  • Windows and MacOS

    • The simplest way to build on Windows and MacOS is to use CMake. In that case, all required dependencies will be downloaded and compiled automatically.

Getting the source

Ensure you obtain the repository recursively.

git clone https://github.com/meganz/MEGAcmd.git
cd MEGAcmd && git submodule update --init --recursive

Building and installing

With Autotools

For platforms with Autotools, MEGAcmd can be built and installed with:

sh autogen.sh
./configure
make
make install
  • You will need to run make install as root

Note: if you use a prefix in configure, autocompletion from non-interactive usage won't work. You would need to source /YOUR/PREFIX/etc/bash_completion.d/megacmd_completion.sh (or link it at /etc/bash_completion.d)

With CMake

With CMake, all third-party libraries and dependencies will be downloaded and compiled automatically in ../3rdparty_megacmd/. Nothing else is required; the build_from_scratch script takes care of everything. Just navigate to build/cmake/ and run:

cmake -DTRIPLET=<triplet> -P build_from_scratch.cmake

Some notes on the above command:

  • The <triplet> options are (depending on OS and architecture):
    • For Windows, either x64-windows-mega or x86-windows-mega
    • For MacOS, either arm64-osx-mega or x64-osx-mega
  • After third-party dependencies are downloaded, the build of the project itself may be controlled with an optional -DTARGET parameter (or multiple targets separated by semicolons)
    • If not provided, everything will be built (equivalent to make all)
  • On Windows
    • You can use a CMake version from a newer Visual Studio using the -G option (e.g., -G Visual Studio 16 2019)
    • The directory ../3rdparty_megacmd/vcpkg/installed/<triplet>/debug/bin/ (or ../3rdparty_megacmd/vcpkg/installed/<triplet>/bin for release) must be added to PATH as an absolute path to be able to run the executables properly

If the build is successful, the binaries will be located in build-<triplet>/.

With QtCreator

You can build with QtCreator by opening the Qt project file at contrib/QtCreator/MEGAcmd/MEGAcmd.pro.

Usage

Before explaining the two ways of interaction, it is important to understand how MEGAcmd works. When you login with MEGAcmd, your session, the list of synced folders, and some cache database are stored in your local home folder. MEGAcmd also stores some other configuration in that folder. Closing it does not delete those and restarting your computer will restore your previous session (the same as megasync won't ask for user/password once you restart your computer).

You will need to logout properly in order to clean your data.

Now let's get into details of the two usage modes. Both modes require that MEGAcmdServer is running. You can manually launch it. Fortunately, you can also open the interactive shell or execute any command and the server will start automatically.

Interactively:

Execute MEGAcmd shell. Platform section explains how to do that in the different supported systems. You should be facing an interactive shell where you can start typing your commands, with their arguments and flags.

You can list all the available commands with help.

And obtain useful information about a command with command --help

First you would like to log in into your account. Again, notice that doing this stores the session and other stuff in your home folder. A complete logout is required if you want to end you session permanently and clean any traces (see logout --help for further info).

Non-interactively:

When MEGAcmd server is running, it will be listening for client commands. Use the different mega-* commands available.

mega-help will list all these commands (you will need to prepend "mega-" to the commands listed there). To obtain further info use mega-command --help.

Those commands will have an output value != 0 in case of failure. See megacmd.h to view the existing error codes.

Ideally, you would like to have these commands in your PATH variable (See Platform for more info). For further info use mega-help --non-interactive.

Usage examples

Here are some examples of use (more info and usage examples are available at the User Guide).

Notice: the commands listed here assume you are using the interactive interaction mode: they are supposed to be executed within MEGAcmdShell.

  • A synchronization can be established simply by typing:
sync /path/to/local/folder /folder/in/mega

This will synchronize the contents in your local and your mega folder both ways.

  • You can also set remote backups of a local folder to keep historical snapshots of your files. So simple as:
backup /path/mega/folder /remote/path --period="0 0 4 * * *" --num-backups=10

This will configure a backup of "myfolder" into /remote/path that will be carried out at 4:00 A.M. (UTC) every day. It will store the last 10 copies.

Further info on backups here.

  • You serve a location in your MEGA account via WebDAV:
webdav /path/mega/folder
  • Or stream a file in your MEGA account:
webdav /path/to/myfile.mp4

Further info on webdav and streaming here.

  • Download the contents of a shared link:
get https://mega.nz/#F!ABcD1E2F!gHiJ23k-LMno45PqrSTUvw /path/to/local/folder 

Now let's do something more complicated with non-interactive usage using some GNU tools (similar stuff can be easily done in Windows as well):

  • We want to provide something crypto secured with only 10 minutes of access:
mega-put /path/to/my/temporary_resource /exportedstuff/
mega-export -a  /exportedstuff/temporary_resource --expire=10M | awk '{print $4}'
  • Or imagine we'd like to public the enterprise promotional videos of May 2015 that we have previously stored in MEGA:
for i in $(mega-find /enterprise/video/promotional2015/may --pattern="*mpeg"); do 
mega-export -a $i | awk '{print $4}'; 
done

Platforms

Linux

If you have installed MEGAcmd using one of the available packages at here.

Or have it built without --prefix, both the server (mega-cmd-server), the shell (mega-cmd) and the different client commands (mega-*) will be in your PATH (on a fresh install, you might need to open your terminal again).

If you are using bash, you should also have autocompletion for client commands working.

If that is not you case, include the location for the binaries in your PATH variable.

Windows

You can have MEGAcmd installed using the installer from here.

If you are interested in installing MEGAcmd without human intervention, notice that this installer supports silent installation, you just need to execute in your command prompt:

MEGAcmdSetup.exe /S

Once you have MEGAcmd installed, you just need to execute it (via Desktop icon or Start Menu) to open the shell. This will open MEGAcmdServer in the background (a process named MEGAcmdServer.exe).

For a better user experience (specially in Windows 7) we recommend executing MEGAcmd from PowerShell.

Open PowerShell and execute:

$env:PATH += ";$env:LOCALAPPDATA\MEGAcmd"
MEGAcmdShell

For non-interactive usage, there are several mega-*.bat client commands you can use writting their absolute paths, or including their location into your environment PATH and execute them normally (mega-*).

If you use PowerShell and you have installed the official MEGAcmd, you can do that simply with:

$env:PATH += ";$env:LOCALAPPDATA\MEGAcmd"

Client commands completion requires bash, hence, it is not available for Windows.

Caveats

Although there have been several efforts in having non-ASCII unicode characters supported in Windows, there still may be some issues. Pay special attention if you are willing to use pipes or send the output of a command into a file from your client commands. See help --unicode for further info regarding that.

MacOS

Install MEGAcmd from here.

For MacOS, after installing the dmg, you can launch the server using MEGAcmd in Applications. If you wish to use the client commands from MacOS Terminal, open the Terminal and include the installation folder in the PATH.

Typically:

export PATH=/Applications/MEGAcmd.app/Contents/MacOS:$PATH

And for bash completion, source megacmd_completion.sh:

source /Applications/MEGAcmd.app/Contents/MacOS/megacmd_completion.sh

NAS systems

Currently we have build scripts for Synology and QNAP, which can be found in the build/<system> folder along with instructions on how to set up the build. Typically this results in a 'package' which can then be manually installed in the NAS. To use MEGAcmd on those systems, ssh into the device and run the commands as normal (having first added their folder to your PATH variable).

*Important note for MacOS Catalina or above: since Catalina, MacOS uses zsh as default shell. If you want to have auto completion, we strongly recommend you to use bash shell (just execute bash in your terminal).

Features:

Autocompletion:

MEGAcmd features autocompletion in both interactive and non-interactive (only for bash) mode. It will help completing both local and remote (Mega Cloud) files, flags for commands, values for flags/access levels, even contacts.

Verbosity

There are two different kinds of logging messages:

  • SDK based: those messages reported by the sdk and dependent libraries.
  • MEGAcmd based: those messages reported by MEGAcmd itself.

You can adjust the level of logging for those kinds with log command.

However, passing -v (-vv, -vvv, and so on for a more verbose output) to an specific command will use higher level of verbosity of MEGAcmd based messages.

Further info on verbosity here.

Regular Expressions

If you have compiled MEGAcmd with PCRE (enabled by default), you can use PCRE compatible expressions in certain commands with the flag --use-pcre. Otherwise, if compiled with c++11, c++11 regular expressions will be used.

If none of the above is the case, you can only use wildcards: "*" for any number of characters or "?" for a single unknown character.

You can check the regular expressions compatibility with find --help:

find --help
...
Options:
 --pattern=PATTERN	Pattern to match (Perl Compatible Regular Expressions)

Notice: if you use MEGAcmd in non interactive mode, notice that shell pattern will take precedence. You will need to either escape symbols like * (\*) or surround them between quotes (e.g: "*.txt").

MEGAcmd Updates

MEGAcmd updates automatically for Windows & MacOS.

For Linux, whenever there is a new update, it will be published in the corresponding repository and your system's updating tool will let you update it.

Disable automatic updates

You can type update --auto=OFF to disable automatic updates. update --auto=ON will re-enable them.

If you want to see the state of automatic updates you can use update --auto=query. This will inform if automatic updates are enabled or not.

Notice that MEGAcmdServer must be running in order to have automatic updates working.

You can also update manually by typing update within MEGAcmd. This will check if there are updates available and proceed to update if affirmative. Whenever MEGAcmd is updated it will be restarted (all open instances of MEGAcmdShell will be restarted too).

Alternatively you can also execute MEGAcmdUpdater.exe in Windows or MEGAcmdUpdater (located at /Applications/MEGAcmd.app/Contents/MacOS) in MacOS.

Known Bugs

Currently there are certain discrepancies with PATHS when logging into a public folder.

For instance, imagine a folder named toshare with a subfolder named x. If we login in to toshare and execute find /x, this will be the output:

/toshare/x

Whereas if we execute find /toshare/x, we receive an error, since folder absolute path refers to / as root path.

[err: 12:21:51] Couldn't find /toshare/x

It might better be referred as /toshare/x.

megacmd's People

Contributors

aabellagm avatar asheroto avatar bluedrink9 avatar catalinr-m avatar cb-mega avatar cc-mega avatar dhanton avatar donfanning avatar dwmega avatar dyuste avatar gene1wood avatar glensc avatar javiserrano avatar johnnynator avatar joshirio avatar mattw-mega avatar mega-lia avatar njskalski avatar ortmann avatar polmr avatar pushpend3r avatar rl-mega avatar sparklingcomet avatar spookyahell avatar vibhavp avatar vtmateos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

megacmd's Issues

mega-cmd sync behavior

For mega-cmd sync, From what I observe it is a bi-directional sync with no deletes - only adds.
Is this intended behavior of sync? What command will mirror local to Mega? Thanks

How to login?

The Readme section ‘Usage examples’ do not contain any examples of how to login

This line login email password | exportedfolderurl#key | session from mega-login –help command is not clear to me. I do not have a login, in MegaSync I use email and password.

But this command mega-login [email protected] password123 does not work

mega-find -mtime not working

It seems as mega-find with mtime is not working:

I got files from Match 13th and Match 14th.
When I do mega-find -mtime='-1d' I get nothing.
When I do mega-find -mtime='+1d', I get all files, those form 13th and from 14th.

Any help is appreciated.

login with credential file

Hello. I want to create a config file under my home directory with my MEGA account info so when I or my shell try to login mega-login read my credentials from this config file instead of typing email and password. Is there any way to do this current with MEGAcmd tools?

Backup fails

Backup fails, possibly due to date calculating errors.

mega-backup -l says next backup is due in the 70s (Sun, 31 Jul 1977 11:25:01 +0100)

Start of mega-cmd-server:

[info: 13:40:01] Resuming session... [debug: 13:40:02] actUponLogin login [debug: 13:40:02] Login correct ... [debug: 13:40:02] Session file: /home/backupagent/.megaCmd/session [debug: 13:40:02] Syncs file: /home/backupagent/.megaCmd/syncs [debug: 13:40:02] Backups file: /home/backupagent/.megaCmd/backups [debug: 13:40:02] Excluded file: /home/backupagent/.megaCmd/excluded [info: 13:40:02] Fetching nodes ... [info: 13:40:02] Loaded sync: /home/backupagent/targets to /test [debug: 13:40:02] Fetch nodes correctly [info: 13:40:02] Login complete as g***@***.com [info: 13:40:02] Restablishing backups ... [info: 13:40:02] Added backup: /home/backupagent/targets to /backuptargets [debug: 13:40:02] Succesfully resumed backup: /home/backupagent/targets to /backuptargets [debug: 13:40:02] Backups file: /home/backupagent/.megaCmd/backups [info: 13:40:02] Listening to petitions ... [API:err: 13:40:02] Invalid calculated NextStartTime [debug: 13:40:02] 2 folders added or updated [debug: 13:40:02] 2 files added or updated

[Initiating server in background. Log: /home/backupagent/.megaCmd/megacmdserver.log] TAG LOCALPATH REMOT...TPATH STATUS 4 /home...argets /backuptargets FAILED Max Backups: 10 Period: "0 0 4 * * *" Next backup scheduled for: Sun, 31 Jul 1977 11:25:01 +0100 -- CURRENT/LAST BACKUP -- FILES UP/TOT FOLDERS CREATED PROGRESS 0/0 0 0.00/0.00 B 0.00%

System:

Raspbian stretch, locale: EN_us

Share/Invite enhancement

Thanks for your great work, 0.9.6 works very well.
I found only a minor cosmetic issue in userattr. For the logged user the fields authring, lastinteraction, keyring are NOT PRINTABLE; for the other contacts the command gives the error Failed to get user attribute ...: Access denied. It would be better to remove these fields from the output, since in no case their value shows, or return a more sensible output in the second case (rather than an error).

I would also suggest a more relevant improvement. People managing file sharing with CLI scripts are expected to have huge number of contacts. When working in bulk, a project specific invite message is necessary for security reason (so that recipients trust the invitation). Currently this requires two distinct commands invite and share. It would be better if the share command supported a message argument like invite, e.g.:

share [-p] [-d|-a [email protected] [--level=LEVEL]] [remotepath] [--message="MESSAGE"]

Consider that, with large numbers, one has also to setup a separate procedure to collect the email addresses, therefore a single share/invite command would make everything much smoother for the recipients.

Add a script for installing the dependencies

The configurescript checks for configuration and shows errors and then the user has to manually install dependencies and keep repeating the process multiple times.

It would be much more convenient if there was a script to install all required dependencies at one go

Static compilation fails

  • Static compilation currently fails for libcurl
  • To reproduce ...
$ ./configure --enable-static=yes
$ make

[...]
make[4]: Entering directory '/home/babil/MEGAcmd/sdk'
  CXXLD    examples/megacli
/usr/bin/ld: attempted static link of dynamic object `/usr/lib/x86_64-linux-gnu/libcurl.so'
collect2: error: ld returned 1 exit status
[...]

Buffer overflow when running mega-cmd by user with large uid value

It is insufficient to store the temp path in 19 chars. The comments said "enough to hold all numbers up to 64-bits" but it actually only holds 5 digits.

When the uid is a relatively large value (e.g. I use 16777217), this causes buffer to overflow, so mega-cmd-server cannot bind to the unix socket properly, and the command line tools cannot connect to mega-cmd-server.

Output of mega-cmd-server:

[debug: 05:29:45] Language set to: 
[debug: 05:29:45] CREATING sockets folder: /tmp/megaCMD_1677721�:-!!!
[FATAL: 05:29:45] ERROR on binding socket: /tmp/megaCMD_16777217/srv: 2

thumb-nailing

I have a about 300,000 files in mega-sync, all the files are encrypted locally before they hit the local mega dir
The problem is that each time mega starts or even when a new batch of files hit the dir, mega consumes almost 90% of CPU trying to create thumbnails/processes the metadata of the files.
I have the syncs on 3 different servers and this is slowing everything down, it can take up to 45 minute for mega to finish trying to create a thumbnail for all the files.

Please can you make an option to turn off those features its just not possible to continue using it like this.

Thanks

backup -d <path> or backup -d <tag>

In Windows SO the instruction..

backup -d drive:\path\to\myfolder

..show an error and doesn't work.

Works fine as "backup -a" with:

backup -d

Example:

backup -d 62

error make

I get an error when installing.

# make
...
  CXX      examples/linux/examples_linux_megafuse-megafuse.o
In file included from examples/linux/megafuse.cpp:34:0:
./include/megaapi.h:8457:105: error: ‘string’ has not been declared
         void setBackup(const char* localPath, MegaNode *parent, bool attendPastBackups, int64_t period, string periodstring, int numBackups, MegaRequestListener *listener=NULL);
                                                                                                         ^~~~~~
make[4]: *** [Makefile:2395: examples/linux/examples_linux_megafuse-megafuse.o] Error 1
...

Please help me with an error

sync disabled / fails

Just checked my server, and see all the syncs failed.
I rebooted 2 days ago and since then there were no uploads.
for all 3 syncs ActState=Disabled, SyncState=NONE
the log file just states "Failed to resume sync" see attached log file
megacmd_start0.log
I restarted the mega-cmd-server and now i get for 2 syncs ActState=Failed, and for 1 Disabled, for SysncState all =Disabled see log file
megacmd_start1.log

How do I resolve this?
It's a pretty bad situation that without logging in to manually check the sync can just fail and i'm none the wiser

Get command not checking if user is logged in

[user@linux ~]$ mega-exec get a.txt a.txt
[err: 10:57:34] Couldn't find file
[user@linux ~]$ mega-exec put a.txt a.txt
[err: 10:57:38] Not logged in.
[user@linux ~]$ mega-exec ls
[err: 11:00:06] Not logged in.

Most of the commands fail if there's no session active (not logged in), but when using get it fails to find the file. I understand, that you can get public or shared links without the need to log in, but It would help a lot if it could check whether or not the requested file is a valid link (no permission required) and if it is not it could fail with the usual message (not logged in).

When calling MEGAcmd, at this point I really don't know if the file is not found or just the session or the user logged out.

Correct autostart options

How to make mega-cmd-server run on boot? I don't see any builtin option for it. Are there any implemented way of autostart for syncs? I will go with @reboot /usr/bin/mega-cmd-server in user cron for now. Is it right?

SyncState NONE

I had to replace my hard drive, I copied all the files back on to the drive locally to save from downloading 100GB, however the syncs then failed.
~# mega-sync
ID LOCALPATH REMOTEPATH ActState SyncState SIZE FILES DIRS
0 /dir0 /remote0 Failed NONE 16.77 GB 198465 4533
1 /dir1 /remote1 Failed NONE 3.10 GB 7854 435
2 /dir2 /remote2 Failed NONE 31.62 GB 258 133

in megacmdserver.log i see many lines [API:err: 02:01:06] Local fingerprint mismatch. Previous: 64771 Current: 17682494842851675189

when trying to delete the sync
~# mega-sync -d 0
[err: 12:12:30] Failed to remove sync: Not found

even rebooting the server does not help.
How can i reset this situation?

Can't login because of some symbols

Ubuntu 16.04.5. Using Bash.
MEGA CMD version: 0.9.9: code 90900

Here are my attempts:

~ mega-login [email protected] 0"6}S27:.CFS&Oo#g`-lY>bcbVt.DL[i
> mega-whoami
> ^C
~ mega-login [email protected] "0"6}S27:.CFS&Oo#g`-lY>bcbVt.DL[i"
> mega-whoami
> ^C
MEGA CMD> login [email protected]                                                                                                                                      
Password:                                                                                                                                                              
[err: 12:19:36] Login failed: invalid email or password
MEGA CMD> login [email protected] "0"6}S27:.CFS&Oo#g`-lY>bcbVt.DL[i"                                                                                                   
[err: 12:22:57] Login failed: invalid email or password                                                                                                                
MEGA CMD> login [email protected] 0"6}S27:.CFS&Oo#g`-lY>bcbVt.DL[i                                                                                                     
[err: 12:23:29] Login failed: invalid email or password 

I was able to login after I've changed to a more simpler password.

I cant make

Running the autogen.sh script, I noticed that two files were missing. I've found it on the Internet and copied it. The configure command worked fine. But it made an error in the make command. The error output is below;

root@x86-giris-1:/MEGAcmd# make
make all-recursive
make[1]: Entering directory '/root/MEGAcmd'
Making all in sdk
make[2]: Entering directory '/root/MEGAcmd/sdk'
make[2]: * No rule to make target 'all'. Stop.
make[2]: Leaving directory '/root/MEGAcmd/sdk'
Makefile:1341: recipe for target 'all-recursive' failed
make[1]: * [all-recursive] Error 1
make[1]: Leaving directory '/root/MEGAcmd'
Makefile:651: recipe for target 'all' failed
make: *** [all] Error 2
root@x86-giris-1:
/MEGAcmd#

"get" command alters folder name

The get command replaces : (colon) with %3a (url encoding) in folder name. For example:

"Hello: World" > "Hello%3a World"

I can't explain why and I haven't tried anything else. Further testing may be required.
For reference, I am downloading a nested folder structure from a public link.

not all clients in sync

I setup mega-cmd in 2 locations, location 1 is where the files are created so primarily files are uploaded in that location. The other location is download only (i use rsync at that location to have daily offline backup).
However i am struggling to get them to be fully in sync. output of mega-sync in upload location is;

ID LOCALPATH REMOTEPATH ActState SyncState SIZE FILES DIRS
0 /path/to/0/ /remote/0/ Active Synced 16.03 GB 190105 4510
1 /path/to/1/ /remote/1/ Active Synced 3.08 GB 7778 397
2 /path/to/2/ /remote/2/ Active Synced 9.07 GB 74 40

mega-sync in location 2 shows;
ID LOCALPATH REMOTEPATH ActState SyncState SIZE FILES DIRS
0 /path/to/0/ /remote/0/ Active Synced 14.63 GB 174104 4510
1 /path/to/1/ /remote/1/ Active Synced 3.08 GB 7778 397
2 /path/to/2/ /remote/2/ Active Synced 9.07 GB 74 40

in location 2 mega-transfers --only-downloads --show-syncs returns empty so nothing is being downloaded.
The problem primarily seems to be with ID 0 as the others seem to be in sync, how do i get to the root of this?

mega-help not working while using the fish shell

I have fish as my user default shell and when running the command mega-help this is what i get:

The file '/usr/bin/mega-help' is marked as an executable but could not be run by the operating system.

Is there a way to make it work on fish as well? (when i run it on bash it works properly)

Dependencies on a raspberry pi 3 with Raspbian-Lite is Debian stretch

Yesterday I compiled MEGAcmd on a Raspberry Pi 3.
There is a fresh Raspbian-Light installed. That is a stretch without x.
It was a bit time consuming to fiddle out all the dependencies.

Here they are for a Debian stretch:

autoconf
gawk
libc-ares-dev
libcrypto++6
libcrypto++-dev
libcurl4-openssl-dev
libfreeimage-dev
libreadline-dev
libsqlite3-dev
libssl-dev
libtool
sqlite3

copy pasteable:
apt-get install autoconf gawk libc-ares-dev libcrypto++6 libcrypto++-dev libcurl4-openssl-dev libfreeimage-dev libreadline-dev libsqlite3-dev libssl-dev libtool sqlite3

Then the make, make install went absolute smooth.
Maybe that saves somebody some time.

Thanks

backup 'e'stablished string mispelt.

execute this command in mega-cmd on linux / centos 7 (version: using latest rpm package from mega.nz)

backup /somefolder /megafolder/subfolder/ --period="0 0 0 4 * * *" --num-backups=10

Minor spelling error on output.
output: backup stablished: /blah/ period ="0 0 4 * * *" Number-of-Backups=10
expected: backup established: /blah/ period ="0 0 4 * * *" Number-of-Backups=10

Does not work behind proxy

I have cntlm configured in my local PC linked from my company's proxy, and I have exported http_proxy and https_proxy env vars, both in uppercase and lowercase, but when I do 'login [email protected]' and asks for password, it just hangs.
I look at ~/.megaCmd/megacmdserver.log and I got this:

[debug: 05:04:10] actUponLogin login
[debug: 05:04:10] actUponLogin login email: [email protected]
[err: 05:04:10] Failed to Login: Access denied
[err: 05:04:10] ERROR writing output Code to socket: 32
[err: 05:04:10] ERROR writing to socket: 32

Can someone please tell me if this is a bug or is intended behavior???

Installation in Debian 9 fails at the post-install script

Tried to install on Debian 9 with:

curl https://mega.nz/linux/MEGAsync/Debian_9.0/amd64/megacmd_0.9.4-3.1_amd64.deb --output megacmd.deb
apt install ./megacmd.deb -y

At the end of the install I get the following:

dpkg: error processing package megacmd (--configure):
 subprocess installed post-installation script returned error exit status 255
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Errors were encountered while processing:
 megacmd
E: Sub-process /usr/bin/dpkg returned an error code (1)

However mega-cmd seems to work fine.

Then I ran:

dpkg --configure -D 777 megacmd

to get the following output:

D000001: ensure_diversions: new, (re)loading
D000001: process queue pkg megacmd:amd64 queue.len 0 progress 1, try 1
D000040: checking dependencies of megacmd:amd64 (- <none>)
D000400:   checking group ...
D000400:     checking possibility  -> libc-ares2
D000400:       checking non-provided pkg libc-ares2:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libc6
D000400:       checking non-provided pkg libc6:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libcrypto++6
D000400:       checking non-provided pkg libcrypto++6:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libgcc1
D000400:       checking non-provided pkg libgcc1:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libpcre3
D000400:       checking non-provided pkg libpcre3:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libpcrecpp0v5
D000400:       checking non-provided pkg libpcrecpp0v5:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libssl1.1
D000400:       checking non-provided pkg libssl1.1:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libstdc++6
D000400:       checking non-provided pkg libstdc++6:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> zlib1g
D000400:       checking non-provided pkg zlib1g:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> apt-transport-https
D000400:       checking non-provided pkg apt-transport-https:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000040: ok 2 msgs >><<
D000040:     checking Breaks
Setting up megacmd (0.9.4-3.1) ...
D000002: fork/exec /var/lib/dpkg/info/megacmd.postinst ( configure  )
cat: /usr/share/doc/megacmd/distro: No such file or directory
cat: /usr/share/doc/megacmd/version: No such file or directory
dpkg: error processing package megacmd (--configure):
 subprocess installed post-installation script returned error exit status 255
D000001: ensure_diversions: same, skipping
Errors were encountered while processing:
 megacmd

It seems that the following files aren't created:

/usr/share/doc/megacmd/distro
/usr/share/doc/megacmd/version

Which the postinstall script is trying to read.

Am I doing something wrong?

Thanks for any help.

Dev releases

Today I installed the new version of MEGAcmd.
I realised that there is no uninstall item in Windows appwiz.cpl for MEGAcmd.

Also it would be nice if you could anticipate the binary release in GitHub, without forcing users to build themselves the dev release. As of of now this is the case of 0.9.7, not yet available from mega.nz.

mega-cp error: Failed to copy node: Invalid argument

System
Ubuntu 16.04.3 LTS

MegaCMD
MEGA CMD version: 0.0.9: code 90900

size of source remote folder: 371.89 GB
destination remote folder: empty

mega-cp /source_folder /backup_destination_folder

Failed to copy node: Invalid argument

When copying large remote folders I get the above error.

Works well on smaller folders.

multiple backup process

Hi. Is it possible that configure multiple backups with mega-backup? When I add the second backup command the previous one is deleted. Is it normal or I do something wrong?

And another problem is when I log out all my backups configuration are removed. How can I keep my backup configuration even I logged out

sync gets stuck

Over the past week i noticed the sync gets stuck, for hours the same download file remain at 0%.

root@root:~# mega-transfers --only-downloads --show-syncs 
DIR/SYNC TAG  SOURCEPATH    DESTINYPATH         PROGRESS           STATE
 ⇓ ⇵   79772 /nfs-..._B.jpg /nas0..._B.jpg    0.00% of   62.19 KB  ACTIVE
 ⇓ ⇵   79773 /nfs-..._A.jpg /nas0..._A.jpg    0.00% of  132.99 KB  ACTIVE
 ⇓ ⇵   79774 /nfs-..._B.jpg /nas0..._B.jpg    0.00% of   60.85 KB  ACTIVE
 ⇓ ⇵   79775 /nfs-..._A.jpg /nas0..._A.jpg    0.00% of  130.61 KB  ACTIVE
 ⇓ ⇵   79776 /nfs-..._B.jpg /nas0..._B.jpg    0.00% of   60.33 KB  ACTIVE
 ⇓ ⇵   79777 /nfs-..._A.jpg /nas0..._A.jpg    0.00% of  115.86 KB  ACTIVE
 ⇓ ⇵   79778 /nfs-..._B.jpg /nas0..._B.jpg    0.00% of   59.36 KB  ACTIVE
 ⇓ ⇵   79779 /nfs-..._A.jpg /nas0..._A.jpg    0.00% of  131.13 KB  ACTIVE
 ⇓ ⇵   79780 /nfs-..._B.jpg /nas0..._B.jpg    0.00% of   55.26 KB  ACTIVE
 ⇓ ⇵   79781 /nfs-..._A.jpg /nas0..._A.jpg    0.00% of  136.84 KB  ACTIVE
 ...  Showing first 10 transfers ...

In the log file i see

[err: 02:38:36] ERROR writing output Code to socket: 32
[err: 02:38:36] ERROR writing to socket: 32

After restarting mega-cmd-service it continues to download until the next freeze, what can be causing this?

Difference between "showpcr" in MegaCmd and "View sent request" in the web interface

showpcr in MegaCmd, after Outgoing PCRs: shows only a subset of the email addresses in "View sent request" in the web interface. Is this by purpose? Shouldn't it be the same?

showpcr prints both a creation and modification date. What for? And what is the difference? to me they are always the same.

showpcr prints a number of blanks before and after the email addresses, which makes them inconvenient to parse. Please, fix it.

Are hidden users from users -h the same concept as pending users?

Starting the MegaCmd server from a script

Is it possible to start the server from a script?
Using:

& "$env:LOCALAPPDATA\MEGAcmd\MEGAcmd.exe"

halts execution, so it needs to be used from a separate session.

I would like to run the server from a script, check if the command returns successfully and possibly execute the script commands.
Is there any command option to fork MEGAcmd.exe in the background after a successful execution?

Side note:
IMHO naming conventions are a bit misleading for the first time users.

  1. The MEGAcmd.lnk actually links to MEGAcmdShell.exe and not MEGAcmd.exe.
  2. There is no MEGAcmdServer.lnk and this is necessary to run batch scripts.
  3. MEGAcmd.exe starts a server and that is not what the name naturally implies.

I spent some trial-and-error time to catch this. I warmly suggest suggest that in the next release you at least:
Rename MEGAcmd.exe as MEGAcmdServer.exe or the likes.

Video stream

Hello
can api replay if a video is streamable or not ?
thank you
Best regards

configuration file

is there any chance to run MEGAcmd using a specific configuration file?

Installation of megacmd on Ubuntu 16.04

Hi,
I tried to follow your guide to install megacmd on my Ubuntu Server 16.04.

First I cloned the the git repository.

I installed all packaged as suggested on GIT for 16.04
autoconf libtool g++ libcrypto++-dev libz-dev sqlite3-dev libsqlite3-dev libssl-dev libcurl4-openssl-dev libreadline-dev libpcre++-dev libsodium-dev

This one could not be found: sqlite3-dev.

  1. sh autogen.sh - > looked like it worked
  2. ./configure
    checking ZenLib/Ztring.h usability... no checking ZenLib/Ztring.h presence... no checking for ZenLib/Ztring.h... no checking for pthread_create in -lpthread... (cached) yes libmediainfo requires libzen checking for aio_write in -lrt... yes checking for OpenSSL... --with-openssl not specified checking openssl/ssl.h usability... yes checking openssl/ssl.h presence... yes checking for openssl/ssl.h... yes checking for SSL_new in -lssl... yes checking for c-ares... --with-cares not specified checking ares.h usability... no checking ares.h presence... no checking for ares.h... no configure: error: ares.h header not found or not usable configure: error: ./configure failed for sdk
    I really would like to use MEGAsync on my server, but I have to stay with Dropbox unless you have a solution to these install issues.

Thanks
Peter

how to list only folders and respective export links

hello i am confused how to list only folders and respective export links i have read the userguide tried myself but i can't figure it out when i try i either get only folder names or the whole tree with export links
some help would be appreciated.

Graphical interface qnap sinology missing.

I downloaded the app from the qnap store and I must say that it is a bit poor. I understand the will to give free 50 gb to private users but it could be useful to create something that can be useful for companies that pay premium plans. My wants to be an advice, not a criticism.

megacmd on ubuntu ppc64el IBM Power 8

Hello!
I wan't to install megacmd package on my server ubuntu 16.04 installed on IBM Power8 PPC64EL.
The package megacmd-xUbuntu_16.04_amd64.deb doesn't work (is it compliled for intel proc?).
Can someone give me the package compiled for ppc64el platform or explain me how to obtain it?

Thank You.

Download failed. error code:Already exists.

This is an error, but the file is not in my computer. Is this an error because an unsuccessful download has already occurred? How can I download file download history? I am using Raspbian Stretch, I am getting this error although I delete the hidden getxfer.xxxx.mega files in the folder where the files need to be moved.

MEGAcmd sync

In Windows, when using sync I don't see the synced folders set with MEGAsync. Is this the intended behaviour (two different sync channel)?

mega put - didn't update existing file on remote repository

@polmr

Hello.

I tried to use the command

put localfilename remotepath/remotefilename

but it didn't works.
The file is not updated (new file date/time)

If ir remove the file then use the same command (put) it works.

Is it available a command option to overwrite an existing file in remote repository?
If is not available please could add this command option?

UI is huge

I use Debian 9.0 build, screen is 1440p.

The result:

image

Different error codes for different OS configurations

I am using MEGACmd from a client program and while developing and testing it in Windows I was able to get error codes that made sense to each particular situation. Afterwards when I ran such tests in Ubuntu/Linux, in Travis and later in a personal PC I always got error codes not present in megacmd.h.

Notes

  • The error codes I am getting has positive values, e.g. 199.
  • In windows the commands where run using the MegaClient and the mega-<command> batch files.
  • In Linux the commands where run using mega-<command> in a bash shell.

Configuration in Windows 10

MEGA CMD version: 0.9.9: code 90900
MEGA SDK version: 3.3.5
MEGA SDK Credits: https://github.com/meganz/sdk/blob/master/CREDITS.md
MEGA SDK License: https://github.com/meganz/sdk/blob/master/LICENSE
MEGAcmd License: https://github.com/meganz/megacmd/blob/master/LICENSE
Features enabled:

  • CryptoPP
  • SQLite
  • FreeImage
  • sync subsystem

Configuration in Ubuntu 15.10

MEGA CMD version: 0.9.9: code 90900
MEGA SDK version: 3.3.5
MEGA SDK Credits: https://github.com/meganz/sdk/blob/master/CREDITS.md
MEGA SDK License: https://github.com/meganz/sdk/blob/master/LICENSE
MEGAcmd License: https://github.com/meganz/megacmd/blob/master/LICENSE
Features enabled:

  • CryptoPP
  • SQLite
  • inotify
  • fdopendir
  • FreeImage
  • PCRE
  • sync subsystem

Secondary effects

There were tests that moved a file to a folder where another file with the same name was present.
In Windows boths files were identified as one and when I ran a move instruction for that file
name it operated over the last moved file and left the oldest one in that folder. In Linux
both files are keep in the folder but identified as different ones, even if the properties where the
same; when a move operation was run over such filename it operated over both.

get command not working

I'm trying to download a large size file to a remote server . But Whenever I use mega-cmd and get command, I get error as Blocked

[err: 03:51:21] Download failed. error code:Blocked

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.