On 2012-08-03 02:16, blackbird sr71 wrote:
>
> hi,
>
> i have a simple bash script that i am trying to run at a specified time
> as a crontab. the script is:
>
> #!/bin/bash
> cd /usr/local/MATLAB/R2012a/bin
> /matlab -nodesktop -nosplash -r “magic(5), exit”
>
> the script works perfect from the command line, however i cannot get it
> to run via cron.
>
> what environment variables do i have to specify to get this script to
> run.
Basically all those that your program needs. Assume none are set.
Note: next time you send code like above, do so inside code tags.
I am no cron expert here, but these is a nice cron utility for KDE called kcron. Why not start YaST / Software / Software Management, search on kcron and when found, install it. It places a desktop icon at ** /usr/share/kde4/services/kcm_cron.desktop**, but you can create one in your desktop with this text:
Copy the text from the code field to the text editor Kwrite and save it as the file $HOME/Desktop/Kcron.desktop and then mark it executable from terminal with the command:
chmod +x $HOME/Desktop/Kcron.desktop
I have set the options to Run as a different user so it asks for the root password, if you want a system wide cron entry. You should find a new desktop icon called Kcron. Click on it and see the new options for Cron there.