2

I need to automatically issue a command on my CentOS 4.8 server after it reboots and/or powers up. Can someone please tell me where I can place this? Is there a configuration file somewhere for this?

Thanks,

-M

Mike B
  • 11,570
  • 42
  • 106
  • 165

2 Answers2

11

Just put in your crontab:

@reboot /usr/bin/whatever

This has the advantage that it can be done by non-superusers, which rc.local needs.

Coops
  • 5,967
  • 1
  • 31
  • 52
6

You can run scripts upon boot by placing them in the /etc/rc.local file.

ewwhite
  • 194,921
  • 91
  • 434
  • 799