meganz / MEGAcmd

Command Line Interactive and Scriptable Application to access MEGA
Other
1.95k stars 406 forks source link

Backups From Synology NAS #408

Open GuzziMac opened 4 years ago

GuzziMac commented 4 years ago

I have installed MegaCmd on a Synology NAS, and have logged in to my Mega account via SSH from a Linux machine to the NAS running MegaCmd. I have setup a backup using the command backup /volume1/music /Backups/Synology/Music --period="0 0 22 *" --num-backups=5

I am running mega-cmd as an application within the terminal of the NAS and running commands direct from there.

The backup command has been accepted, and logging into Mega I can see that an initial backup folder has been created in the file /Backups/Synology/Music/ which has recreated the directory structure from my local files so all seems OK. If I run the command 'backup' in MegaCmd I can see that the status is 'Ongoing', however there is no data transfer between my NAS and remote Mega. When I attempt further commands in MegaCmd after hitting the return key the command hangs, and the cursor becomes static without returning to a /$ command prompt.

Update After 3 hours I can see that 1 file of 250MiB has copied across into the backup directory so doesn't appear to be a permissions or networking issue. I have ~3TiB of local data which I had intended to backup to Mega - but doesn't seem feasible at this point.

krungthepbob commented 4 years ago

My issue is similar. I setup backups on Synology with with mega-cmd. (Sync works fine and has worked fine for for a long time.) When I setup backups, the process hangs very quickly. By hang, I mean that the backup size doesn't increase when I check on "mega.nz"and when I enter the command "mega-cmd", the system "hangs"and never enters it's command mode. "Ctrl-C" also doesn't get me out.

I have two synology NAS boxes and the problem occurs on both. There is very little on the NASs as I primarily use them as storage devices.

polmr commented 4 years ago

Hello there. Thanks for reporting those and apologies for the late reply.

Based on your descriptions, you might be facing some temporary blocks on your accounts, backup command might be too heavy on your account since it will remove the oldest backup whenever a new one is scheduled. For a huge amount of files, that could potentially cause temporary lockdowns in your accounts while that's processed. When your account is locked, any command that entails a remote action will hang until the lock is resolved. That includes resuming your session when you first start MEGAcmd.

How many files & folders are you trying to back up? If the amount is too huge I would recommend you to stick to sync, which establishes a two way sync between your local and remote folder, while keeping old versions of files in MEGA (see https://mega.nz/help/client/webclient/cloud-drive/can-i-manage-versions-of-my-files-in-mega-59f13b42f1b7093a7f8b4589 for further info on versioning).

Also, could you tell what is the output of backup -lh after first setting the backup? Note: if MEGAcmd is temporary blocked, you could unset the backups by simply removing backups file in your ~/.megaCmd folder and then restart mega-cmd-server process again [and be patience for temporary locks to resolve].

Finally, having a log that covers the first setting of a backup until the moment when the locking occurs might help us confirm that the above theory is correct and there is no special issue in Synology NAS. If you were kind enough to provide it for us, we would appreciate it. In order to do so, please ensure mega-cmd-sever is not running and execute it in debug mode:

Open a console and type

mega-cmd-server --debug-full | tee megacmd.log

Then, open another console and configure the backup. Let the issue happen, and Quit mega-cmd-server now (Ctrl+C or typing mega-quit in the second console)

Then please send us that megacmd.log file. The log might contain some sensitive data. Feel free to remove anything you don't want to share with us. Then send it to support@mega.nz and refer this issue in your email so that it can reach development team.