Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to use @reboot /my/script in cron to run a script on a 10.04.4 VM running in VMware Fusion top print ifconfig to a file on a shared directory, which is /mnt/hgfs/somedir.

It didn't work because hgfs is not mounted yet as a remote directory when the system starts. Is it possible to do something like @reboot +10s to run the cron job 10 sec after the system starts, when I can realistically expect to have that remote directory mounted on the system?

share|improve this question
up vote 3 down vote accepted

You could simply add

sleep 10

to the beginning of your script. This way, your script will "sleep" (wait) 10 seconds before continuing.

share|improve this answer
brilliant, thanks. why didn't i think of that? – amphibient May 8 '14 at 22:38

For a more robust option, your cron job could be

 @reboot until [ -d /mnt/hgfs/somedir ]; do sleep 1; done; /my/script

That will wait until the directory actually exists, so you don't need to guess how long it will take or worry that it might take longer.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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