11/06/2016

Ubuntu : Run a script at startup with a crontab.

Ubuntu : Run a script at startup with a crontab.
1. Create file .sh example
  1. nano /etc/init.d/startVbox.sh


2. Insert Code. For run command we wants.
  1. #!/bin/sh
  2. sudo vboxwebsrv -H 127.0.0.1 > null
  3.  

OR
  1. #!/bin/sh
  2. sudo service apache2 restart


3. insert to crontab by. insert @reboot /path file
  1. crontab -e

  1. @reboot /etc/init.d/startVbox.sh


4. Test reboot. After reboot code in crontab just run.

http://ubuntuforums.org/showthread.php?t=2170820

No comments:

Post a Comment