The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 2,028     Votes:  6     ✅ Solution
Tag : cron  
Link: 🔍 See Original Answer on Ask Ubuntu ⧉ 🔗

URL: https://askubuntu.com/q/846557
Title: cron launching but not executing script
ID: /2016/11/07/cron-launching-but-not-executing-script
Created: November 7, 2016    Edited:  November 7, 2016
Upload: April 8, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


It looks like the executable ruby is not in cron’s path, so you need to use the full path to the executable.

Change your monday.sh script from:

#!/bin/bash
ruby ~/Documents/Scripts/monday_task.rb >> ~/Documents/Scripts/monday

to:

#!/bin/bash
/home/asarluhi/.rvm/rubies/ruby-2.3.1/bin/ruby /home/asarluhi/Documents/Scripts/monday_task.rb >> /home/asarluhi/Documents/Scripts/monday

As your syslog demonstrates the monday.sh script is being run on time so absolute path-names is the only answer. As per OP comment ruby also has to be prefixed with absolute path-name.

⇧ How can I create new "gksu" command based on pkexec? How to create a directory within your home directory - Linux  ⇩