0

I have used this command directly with the command line and it working fine.

sudo ~/.dropbox-dist/dropboxd

But when I set it to run each minute with cronjob nothing happens. my crontab file

# m h  dom mon dow   command
* * * * * sudo ~/.dropbox-dist/dropboxd
@hourly wget -qO /dev/null https://mysite.com/cron/KpFh734nRJIBMtAAH1-32ajb8Rv23A-l0pBVg$

what is wrong?

3 Answers3

2

Generally speaking, crontab is not aware of environment variables. You should indicate the full path. In this example it may be:

/home/youruser/.dropbox-dist/dropboxd

sudo may need a password, so it may not achieve what you expect in a cron job. It may just be an example, but I am puzzled by the fact that you need to run the Dropbox deamon every minute.

Arduous
  • 55
1

It shouldn't be sudo. Should be the user name. And don't use ~ , use absolute path. like

* * * * * root /home/user/.dropbox-dist/dropboxd

or

* * * * * user /home/user/.dropbox-dist/dropboxd

Also please note that in either case, root or user should have execute permission on the script.

0

I fix the issue with change my cron command like this:

@reboot ~/.dropbox-dist/dropboxd

but this is not enough and I should run another command:

($HOME/.dropbox-dist/dropboxd &)&

after this for the test when I run this command

sudo ~/.dropbox-dist/dropboxd

I will see this message that means Dropbox is running, and all changes will sync with Dropbox account immediately.

Another instance of Dropbox (25068) is running!