I am new to shell scripting. I wrote basic simple.sh file on mac. I put my .sh file to /usr/local/bin directory and I added sh file to the chrometab so as to run every minute. My sh file works fine on standalone terminal screen but I can't delete the folder I want on crometab. Could you please help me? What's my problem? I tried to crontab -e, sudo crontab -e but I can't delete folder I want.
os: macOs Catalina 10.15.7
#! /bin/bash
downloadsDirectoryPath="/Users/Odin/Downloads/"
sampleFolderPath=$downloadsDirectoryPath"sampleFolder"
logFilePath=$downloadsDirectoryPath"log.txt"
sudo rm -rf $sampleFolderPath # this row not works, why???
echo "this row absolutely works" >> $logFilePath
I solved the problem with allow full disk access permission to the cron and crontab. Thanks for help @GordonDavisson