Leave a comment

Writing cron job to run tasks on every system reboot.

Yesterday i dealing with the problem that i want to start delayed_job in rails after each system reboot.

after finding for a while i find that we can set a “cron job” which will execute after each rebbot by just wrting following command :

first type crontab -e
that will open an cron editor and then just type below line

@reboot cd /var/www/current_project_path && /usr/bin/ruby1.9.1 script/delayed_job start

and dont forget to restart the cron job after editing crontab.
you can restart the cron job by giving command ‘/etc/init.d/cron restart’


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: