duplicity.backends.megav3backend module

class duplicity.backends.megav3backend.Megav3Backend(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 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

__init__(parsed_url)[source]
_check_binary_exists(cmd)[source]

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

_close()[source]

Function called when backend is done being used

_delete(filename)[source]

Deletes file from the specified remote path

_get(remote_filename, local_path)[source]

Downloads file from the specified remote path

_list()[source]

Lists files in the specified remote path

_makedir(path)[source]

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)

delete(remote_file)[source]

Deletes a file from a remote MEGA path

download(remote_file, local_file)[source]

Downloads a file from a remote MEGA path

ensure_mega_cmd_running()[source]

Trigger any mega command to ensure mega-cmd server is running

folder_contents(files_only=False)[source]

Lists contents of a remote MEGA path, optionally ignoring subdirectories

mega_login()[source]

Helper function to check existing session exists

upload(local_file, remote_file)[source]

Uploads a file to a remote MEGA path