I finally got around to using Megatools. I use Tarsnap for database backups and now I’m using Mega to share files in our organization. I read trough the megatools manpage and it’s not very clear on how to enter a command, or how to get a file from an existing Mega drive. After a little tinkering I found this is the way.
command --username ‘username’ --password 'password’
For example if I want a directory listing I would type
megals --username ‘username’ --password ‘password’
Copying a file from the Mega drive is a bit more tricky, because you have to specify the local and remote folders. Here is how I did it
megacopy --remote /Root/MEGAsync/ TEST.pdf --local ~/Documents --username ‘username’ --password ‘password’
putting a file in the root folder is easy . We just do
megaput ~/Documents/TEST.pdf --username ‘username’ --password ‘password’
I also found that you can add --path to save it to a specific folder in the mega drive. I have not had any luck with it yet, but this will at least give anyone trying this out a headstart, that I wish I had.
If you can, try to avoid using spaces on your filenames. My users insist on using spaces and it gives me a lot of headaches.