submitted 1 year ago* (last edited 1 year ago) by to c/linux@lemmy.ml
 

Hi

When I setup a cron job like this crontab -e

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

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

BUT doing

*/1 * * * * cd /Path/To/Script && Script.sh
#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.

you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 1 year ago (1 child)

I see you already got the answer. But if you are new to Linux I'd suggest to play overtwire bandit. This will significantly improve your Linux command knowledge.

  • source
  • hideshow 1 child comment