I've got a binary file I want to execute every minute. I've opened up the cron config file by running crontab -e
and added the following line:
* * * * * tutchi -logpath /home/user/path/logs/myfile.log
This did not work so I tried adding the full path to the binary
* * * * * /home/user/path/bin/tutchi -logpath /home/user/path/logs/myfile.log
But still does not work. I know the command I'm running is correct because if I just run /home/user/path/bin/tutchi -logpath /home/user/path/logs/myfile.log
then everything runs fine. I also know that the cron tasks are working because I created a dummy one that runs every minute and echos something into a log file
I checked the log file and everything seems alright no errors other than my mail server not being set up
Oct 24 23:36:51 hairbuddy-notify cron[25522]: (CRON) INFO (pidfile fd = 3)
Oct 24 23:36:51 hairbuddy-notify cron[25522]: (CRON) INFO (Skipping @reboot jobs -- not system startup)
Oct 24 23:37:01 hairbuddy-notify CRON[25527]: (rodzz) CMD (/home/rodzz/hairbuddy/bin/tutchi -logpath /home/rodzz/hairbuddy/logs/tutchi.log)
Oct 24 23:37:12 hairbuddy-notify CRON[25526]: (CRON) info (No MTA installed, discarding output)
Oct 24 23:38:01 hairbuddy-notify CRON[25542]: (rodzz) CMD (/home/rodzz/hairbuddy/bin/tutchi -logpath /home/rodzz/hairbuddy/logs/tutchi.log)
Oct 24 23:38:13 hairbuddy-notify CRON[25541]: (CRON) info (No MTA installed, discarding output)
Oct 24 23:39:01 hairbuddy-notify CRON[26497]: (rodzz) CMD (/home/rodzz/hairbuddy/bin/tutchi -logpath /home/rodzz/hairbuddy/logs/tutchi.log)
Oct 24 23:40:01 hairbuddy-notify CRON[26955]: (rodzz) CMD (/home/rodzz/hairbuddy/bin/tutchi -logpath /home/rodzz/hairbuddy/logs/tutchi.log)
Oct 24 23:41:01 hairbuddy-notify CRON[26970]: (rodzz) CMD (/home/rodzz/hairbuddy/bin/tutchi -logpath /home/rodzz/hairbuddy/logs/tutchi.log)
Oct 24 23:42:01 hairbuddy-notify CRON[26980]: (rodzz) CMD (/home/rodzz/hairbuddy/bin/tutchi -logpath /home/rodzz/hairbuddy/logs/tutchi.log)
Oct 24 23:43:01 hairbuddy-notify CRON[26991]: (rodzz) CMD (/home/rodzz/hairbuddy/bin/tutchi -logpath /home/rodzz/hairbuddy/logs/tutchi.log)
bash
. – Rohitt Vashishtha Oct 24 '16 at 16:10* * * * * bash -c "/home/user/path/bin/tutchi -logpath /home/user/path/logs/myfile.log"
– Rohitt Vashishtha Oct 24 '16 at 16:12