Jump to content
dee31797

[BETA] Megatools - Mega.nz sync tool - Docker

5 posts in this topic Last Reply

Recommended Posts

Megatoolshttps://megatools.megous.com/

 

A simple docker container that allows you to one-way sync a directory from Unraid to Mega.nz service.  Uses the latest megatools Github version.

The container will upload the files from Unraid to Mega.nz, and if files exists on Mega.nz but not on Unraid, it will remove those files from Mega.nz.  It will not ask you to confirm the removal.

The container requires a file with your Mega.nz login credentials saved in the appdata/config directory you're using and named ".megarc".  An example of this file here https://github.com/djaydev/docker-megatools/blob/master/.megarc

 

For multiple directories, you can create separate containers mapped to each directory you want to sync, ex. megatools-pics, megatools-docs, etc.

 

Once the container is started and it has finished copying/deleting, it will exit and shutdown the container.  To start the sync again just start the container from the GUI or command line "docker container start megatools". 

You can also pair the container with the User Scripts plugin for a scheduled sync:

#!/bin/bash
docker container start megatools

 

The container is Beta and has the following issues:

It has to start at the top/root directory of Mega.nz, can and will copy the subdirectories.  I had issue setting the remotedir to "/Root/foldertop/secondfolder/" for example, but "/Root/foldertop/" works great.

The REMOTEDIR variable has to have a / on the end or the delete won't work at all, upload still works.

 

 

Edited by dee31797

Share this post


Link to post

Interesting, i will gave this docker a spin. Works as intended.

Are u planning support for docker secrets and variables to store the credentials?

 

Thanks for creating and sharing.

Share this post


Link to post
2 minutes ago, SiNtEnEl said:

Interesting, i will gave this docker a spin. Works as intended.

Are u planning support for docker secrets and variables to store the credentials?

  

Thanks for creating and sharing.

I'm not familiar with docker secrets at the moment. 

I have looked into username and password variables, and I have somewhat of an idea on how to add it if there's enough interest.  I really like the .megarc file method though, are you concerned with security of using the .megarc file or it's more convenience?

  • Like 1

Share this post


Link to post

Rather have no external services passwords in clear on the server. But this is personal.

The file gives enough convenience, but using variables makes it easier for novice users to get around with the docker template especially when u add it to Community Applications (CA) later on. On the other hand using secrets is not to novice friendly either, so variables is a good start and maybe adding it to CA as well.

Share this post


Link to post

Thinking about it more after your post, I agree with you actually.  With container variables, the password will show up in cleartext in the template file on the flash drive, but flash access will probably be more secured than a share in most cases.

 

I'll start testing it.  The megarc file can be used for more than login credentials such as download speed limit, proxy, etc so I'll leave it's reference in there.  If the user doesn't specify their username/password megatools will already output an error message saying so.

Thanks for posing the idea.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now