How to set up a cron job to run an executable every hour?
0 * * * * cd folder_containing_exe && ./exe_name
should work unless there is something else that needs to be setup for the program to run.
The solution to solve this is to find out why you're getting the segmentation fault, and fix that.
You can also use @hourly
instant of 0 * * * *
If you're using Ubuntu, you can put a shell script in one of these directories: /etc/cron.daily
, /etc/cron.hourly
, /etc/cron.monthly
or /etc/cron.weekly
.
For more detail, check out this post: https://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job