I have the following shell script:
#!/bin/bash matlab -nodisplay -nosplash -nodesktop -r "run('/home/username/test.m');exit;"
The test.m script is a matlab script that plots a graph and saves the figure as pdf without making the figure visible. Below is the content of the test.m script:
% This is a matlab script to test with *at* execution. t1=[1 2 3]; t2=[1 2 3]; plot(t1,t2) set(gcf,'Visible','off') print('-bestfit','/home/username/image','-dpdf')
What I want to do is to schedule the shell script to run at certain time. Therefore I am using the "at" command as follows:
echo "run_matlab_script.sh" | at 15:00
But when the time is 15:00 , the script seems to not be executed. I have also tried including the path to my script, but don't get "at" to work.
I have been following the instructions in this link as well:
Am I using "at" the correct way? Is there an alternative to schedule the execution of a script.
When I do
source run_matlab_script.sh the script runs without issues.
For the shell script I gave it permissions with:
chmod +x run_matlab_script.sh