- Run container with Mega CMD server and mounted configuration and data directories.
- Obtain session using your login and password.
- Execute necessary commands.
Because of the issue #623
we need to have an unique UUID at /etc/machine-id
. Otherwise, mega-sync
will not work.
We have 2 options:
- Bypass the
machine-id
from the host.
docker run -d --name megacmd --restart always \
-v /etc/machine-id:/etc/machine-id:ro \
-v /opt/MEGA/config:/root/.megaCmd \
-v /opt/MEGA/data:/root/MEGA \
ruslanys/megacmd
- Generate a new UUID for the container.
docker run -d --name megacmd --restart always \
-v /opt/MEGA/config:/root/.megaCmd \
-v /opt/MEGA/data:/root/MEGA \
ruslanys/megacmd
docker exec -it megacmd bash
cat /proc/sys/kernel/random/uuid > /etc/machine-id
docker exec -it megacmd mega-login $username $password
docker exec -it megacmd mega-sync /root/MEGA /