2

I have a server with Ubuntu 14.04 and I need to sync (real-time sync, not push-pull via cronjob) with a mega.nz account. Right now my solution was to install Mate and megasync gui app, but I want remove the desktop environment. Is there way to use Xvfb instead?

I'd also like to have Xvfb behave like a service so I can start automatically when system boots up.

user19291
  • 133

3 Answers3

1

Old, but I thought this could use a better answer. MEGA has released an app for that.

MEGAcmd User Guide

sync

Sets up synchronisation between a local folder and one in your MEGA account.

Usage:

sync [localpath dstremotepath| [-dsr] [ID|localpath]

If no argument is provided, it lists current configured synchronizations

If provided local and remote paths, it will start synchronizing a local folder into a remote folder

If an ID/local path is provided, it will list such synchronization unless an option is specified.

Options:
  -d ID|localpath deletes a synchronization
  -s ID|localpath stops(pauses) a synchronization
  -r ID|localpath resumes a synchronization
  --path-display-size=N  Use a fixed size of N characters for paths

Syncs are associated with your Session, so logging out will cancel them.
0

Here's an example of commands you need to run in order to sync desired folder via megacmd:

First, login:

mega-login <email> <pass>

Second, setup folder to sync:

mega-sync /<local_folder> <remote_path>/<of_some>/<mega_folder>

Answering your question, to sync all files from mega on your server:

mega-sync /<local_folder> /

Where / denotes root of your mega account's "filesystem".

To autostart, run mega-cmd-server.

-1

You can use Mega's CLI app, megacmd, instead. See https://mega.nz/cmd

From the readme:

MEGAcmd provides non UI access to MEGA services. It intends to offer all the functionality with your MEGA account via commands.

Available packages for MEGAcmd in all supported platforms should be found here.

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.