1

I want to run a simple command after boot.

cd /mypath
# then
./mycommand

How can I do it?

Zanna
  • 72,312
Hassan
  • 11
  • 1
  • 2

1 Answers1

2

Two solutions:

The first one is to put the full path of the command in /etc/rc.local:

/mypath/mycommand

or, the cron way:

crontab -e

@reboot cd /mypath;./mycommand

From the crontab manual:

 @reboot        Run once, at startup.
user8292439
  • 3,878
  • 7
  • 32
  • 57