duplicity.backends.megav2backend module

class duplicity.backends.megav2backend.Megav2Backend(parsed_url)[source]

Bases: Backend

Backend for MEGA.nz cloud storage, only one that works for accounts created since Nov. 2018 See https://github.com/megous/megatools/issues/411 for more details

This MEGA backend resorts to official tools (MEGAcmd) as available at https://mega.nz/cmd MEGAcmd works through a single binary called “mega-cmd”, which talks to a backend server “mega-cmd-server”, which keeps state (for example, persisting a session). Multiple “mega-*” shell wrappers (ie. “mega-ls”) exist as the user interface to “mega-cmd” and MEGA API The full MEGAcmd User Guide can be found in the software’s GitHub page below : https://github.com/meganz/MEGAcmd/blob/master/UserGuide.md


Checks that a specified command exists in the running user command path


Function called when backend is done being used


Deletes file from the specified remote path

_get(remote_filename, local_path)[source]

Downloads file from the specified remote path


Lists files in the specified remote path


Creates a remote directory (recursively if necessary)

_put(source_path, remote_filename)[source]

Uploads file to the specified remote folder (tries to delete it first to make sure the new one can be uploaded)


Deletes a file from a remote MEGA path

download(remote_file, local_file)[source]

Downloads a file from a remote MEGA path


Lists contents of a remote MEGA path, optionally ignoring subdirectories


Helper function to call from each method interacting with MEGA to make sure a session already exists or one is created to start with

upload(local_file, remote_file)[source]

Uploads a file to a remote MEGA path