0

Is there a command to start a program after a delay?

Something like shutdown 0 for firefox where firefox launch after a delay.

I was following this tutorial where it says adding sleep 150 adds a delay of 150 seconds before it starts the program. But it doesn't seem to be working. The program never launches on startup after I made this edit.

Sandeep C
  • 1,081
  • 2
    What exactly do you want to achieve? I read it as "start firefox 150 seconds after system startup/boot/login" but according to your question's title sleep 150; firefox in a command line would do. – PerlDuck Mar 29 '18 at 13:25
  • 1
    Do you want this at boot/reboot of the computer, or delayed after you run a command (manually)? Or some other way? Please explain. – sudodus Mar 29 '18 at 13:32
  • @sudodus I think I figured out: according to the tutorial he wants a new entry in Startup applications that starts firefox with a delay of 150 seconds. – PerlDuck Mar 29 '18 at 13:33
  • 1
    @PerlDuck, Yes, this is what I think too, but let us wait for an answer from Sandeep C. - Firefox and other GUI programs should be started that way. Programs that need not communicate with the desktop (that read from files and write to files) can be started via crontab '@reboot'. – sudodus Mar 29 '18 at 13:37
  • Yes, @PerlDuck identified my requirement correctly. For example, I edited the command to sleep 120; dropbox start -i after reading the tutorial. But, Dropbox never launches on startup now. So what is the correct method of implementing this?

    Does bash -c "sleep 10m && dropbox start -i" work?

    – Sandeep C Mar 30 '18 at 09:56

0 Answers0