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,871
  • 42
  • 107
  • 168

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
  • 6,055
  • 1
  • 34
  • 54
6

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

ewwhite
  • 197,159
  • 92
  • 443
  • 809