0

I want to add the MEGA sync program to my Ubuntu 12.04 startup list. The download package for MEGA includes an executable which starts the program when opened. Either by finding it with the gui or simply typing into the terminal:

~/Downloads/megasync/usr/bin/megasync

will start the program. However, when I add this command into the startup applications program in Ubuntu it does not work. When the computer reboots and I open the startup applications program, the item is just blank fields now like so:

enter image description here

(This is after clicking Edit in the sidebar.)

I've even tried adding the command as a cronjob like so:

@reboot ~/Downloads/megasync/usr/bin/megasync

and once again nothing happens. Also, checking the "Start on startup" box in the MEGAsync settings window does nothing. When the computer reboots, the box is unchecked again.

I should say that I'm using a virtual machine. But I don't think that would make a difference here.

Any thoughts?

EDIT - I downloaded the megasync client from https://mega.co.nz/#sync

which megasync 

This produces no output. whereis -b megasync produces

megasync: 

ls -al ~/scripts/usr/bin/megasync produces

 -rwxr-xr-x 1 pf pathfinder 4881172 May  3 19:53 /home/pf/scripts/usr/bin/megasync

Note I did copy megasync to a new directory.

  • 1
    Please look here: askubuntu.com/a/624890/72216 there are two possible bottlenecks: use absolute paths (you must do that anyway, like @eldergeek mentioned), or timing issues: some commands break if they run before the desktop is fully loaded, see the link. – Jacob Vlijm May 29 '15 at 20:46
  • 1
    In your case, I would try adding: /bin/bash -c "sleep 20&&/absolute/path/to/megasync" to startup applications. – Jacob Vlijm May 29 '15 at 20:54
  • Did you by any chance install it following these instructions? askubuntu.com/questions/545299/… – Elder Geek May 29 '15 at 21:00
  • @JacobVlijm This did not work. – codedude Jun 1 '15 at 13:20
  • 1
    @codedude Then try increasing the sleep 20 (start with 90, if it works, decreas it step by step). Probably as a result of being a VM, the loading time needs to be increased. If the command works normally, I am pretty sure it should work. – Jacob Vlijm Jun 1 '15 at 13:41
2

The path you provided is virtual in that the ~ stands for /home/$USERNAME$ where $USERNAME$ is your username. Try again with a full path like /home/pf/scripts/usr/bin/megasync. Replace pf with your actual username. Clearly you have execute permissions for megasync so that's not the issue. which megasync coming up blank indicates to me that that bash can't find the executable (it's not on your path). For more on the differences between which and whereis see: https://superuser.com/questions/40301/which-whereis-differences. If it's a timing play as Jacob Vlijm indicates in the comments you could call it with a homemade script that includes the necessary sleep time. You should simply re-install it as it appears it wasn't installed correctly. When I install via software center I get megasync placed on my path. I doubt moving the executable around has helped you. The following should produce the following result if megasync is installed correctly.

 which megasync
/usr/bin/megasync

after proper installation ls- al /usr/bin/megasync should produce

-rwxr-xr-x 1 root root 4807432 May 3 20:56 /usr/bin/megasync clearly what you have is the wrong size and carries the wrong ownership. The copy you have may have been an extremely short lived interim release or may have been corrupted in some fashion. If anything is unclear, please advise and I'll attempt to clarify.

  • This did not work. – codedude May 29 '15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.