April 23, 20179 yr I have written a few ruby scripts that I want to run at certain times everyday. I cannot figure out why they do not run. Details: I have created the directory /boot/config/plugins/mycrons ; within this directory I have a file called cronjobs.cron with the following instructions: " # Scheduled ruby delete at this time every day: 40 02 * * * /usr/bin/ruby /mnt/user/files/Ruby/delete.rb &> /dev/null # Scheduled ruby delete1 at this time every day: 00 03 * * * /usr/bin/ruby /mnt/user/files/Ruby/delete1.rb &> /dev/null # Scheduled ruby deleterar at this time every day: 20 03 * * * /usr/bin/ruby /mnt/user/files/Ruby/deleterar.rb &> /dev/null " When I run telnet command "cat /etc/cron.d/root" to view the current crons - the result is my above crons (along with the parity cron) - which had me confident that the crons would run at their scheduled times. But they did not. The error in my log is "Apr 23 02:40:01 Tower crond[1495]: exit status 1 from user root /usr/bin/ruby /mnt/user/files/Ruby/delete.rb &> /dev/null" Any ideas on what I am doing wrong here? Thanks in advance for any assistance.
April 23, 20179 yr The cron job did run but exited with an error on the first ruby script. First, follow the suggestion of squid. Second, do they run when the array is started, since "/mnt/user/..." is only available when the array is up.
April 23, 20179 yr Author 1 hour ago, Squid said: does that command execute manually? Squid - yes it does
April 23, 20179 yr Author 1 hour ago, bonienl said: The cron job did run but exited with an error on the first ruby script. First, follow the suggestion of squid. Second, do they run when the array is started, since "/mnt/user/..." is only available when the array is up. Yes the array was started was started when it ran and received the error.
April 23, 20179 yr You need to make sure your script exits with a code 0 (assuming there is no real error), otherwise the cron job will fail.
Archived
This topic is now archived and is closed to further replies.