MEGAcmd
MEGAcmd copied to clipboard
Correct autostart options
How to make mega-cmd-server run on boot? I don't see any builtin option for it. Are there any implemented way of autostart for syncs? I will go with @reboot /usr/bin/mega-cmd-server
in user cron for now. Is it right?
If I'm not mistaken that would initiate the server as root. Which I understand that's not what you'd want. You might want to add an entry at $HOME/.config/autostart/megacmd.desktop. Something like:
[Desktop Entry]
Type=Application
Version=1.0
GenericName=File Synchronizer
Name=MEGAcmd
Comment=Easy automated syncing between your computers and your MEGA cloud drive.
TryExec=mega-cmd-server
Exec=mega-cmd-server
Icon=mega
Terminal=false
Categories=Network;System;
StartupNotify=false
X-GNOME-Autostart-Delay=30
We should however add the corresponding scripts to be able to run it as a service (that's in our TODO list)
Any update on this ?
This hasn't been addressed yet, but it's still in the roadmap.
I made a suggestion for a similar issue at https://github.com/meganz/MEGAcmd/issues/235.
Has it been addressed as yet?
I'm also interested in running mega-cmd-server as daemon.
Looking forward for this option, right now working on a script which can start mega server if its not already running, so my daily backup is not disturbed.
Looking forward for this option, right now working on a script which can start mega server if its not already running, so my daily backup is not disturbed.
Did you manage to get the script to auto-start mega-cmd ? do you mind sharring? My backups are being stoped
backup is set using the command specified on mega site. My only problem was mega process was not running whenever server restarts.
Solution I found was, shell script which checks for mega process, if its not running, starts it.
Here is the script link https://github.com/hibare/Rapler-Scripts/blob/master/process_monitor.sh
Schedule a cron job for this script. Mine is set to run every hour as I don't want to miss regular backups.
Have been using it from last couple of months, does the job just fine.
My solution was to create a systemd service for megacmd, and set enable it. Works like charm.
Thanks better than mine
Create a file in "/etc/systemd/system/mega-cmd.service" containing:
[Unit]
Description=Mega-CMD systemd service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=1
User=pi
ExecStart=/usr/bin/mega-cmd-server
[Install]
WantedBy=multi-user.target
Then run
# systemctl start mega-cmd
# systemctl enable mega-cmd
Any clue on how to achieve this on Windows 10?
Create a file in "/etc/systemd/system/mega-cmd.service" containing:
[Unit] Description=Mega-CMD systemd service After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=on-failure RestartSec=1 User=pi ExecStart=/usr/bin/mega-cmd-server [Install] WantedBy=multi-user.target
Then run
# systemctl start mega-cmd # systemctl enable mega-cmd
This Solve my situation like those persons in this issue. Just replace the user and now the service is always running and start and any server restart.
If I'm not mistaken that would initiate the server as root.
only if that were root's crontab. I have the mega users's crontab set up this way (with the @reboot) and it works fine.