Skip Navigation

Crontab problems... 😤

Hi

When I setup a cron job like this crontab -e

 bash
    
*/1 * * * * echo $A_VARIABLE > /home/user/Desktop/test.txt


  

no problem, the file is created whether the variable exist or not.

BUT doing

 bash
    
*/1 * * * * cd /Path/To/Script && Script.sh

  
 bash
    
#The Script.sh
echo $A_VARIABLE > /home/user/Desktop/test.txt


  

Do not generate the file ! and The CRON log give me

(CRON) info (No MTA installed, discaring ouput)

and yes, the  Script.sh has the execution bit.

Any ideas ?

Thanks.

8 comments
8 comments