cron won't run shell script that works in terminal
i created the following script to create a tar archive of a directory and it's contents. the rm command is removing a previous archive that exists in the folder before executing tar to create a new one:
#!/bin/sh
# Script to fetch iOS backup for iphone and tar it in the archives folder
export PATH=$PATH:/usr/bin
rm -rv /Users/username/Documents/iOS\ Archives/username\ iphone\ archive.tar
tar -cvf /Users/username/Documents/iOS\ Archives/username\ iphone\ archive.tar /Users/username/Library/Application\ Support/MobileSync/Backup/00008110-000174E83682801E/*
i made it executable by running:
chmod +x scriptname.sh
and i was able to execute it successfully from terminal by typing:
./scriptname.sh
but i can't figure out how to get cron to run the script. i added the following line:
00 19 * * 1 /Users//Documents/Scripts/\ iphone\ archive.sh
nothing happens at the event day and time
does anyone have any guidance ? i am not a programmer or IT person, but want to do this in order to get away from using apple's archive utility for creating my archives.
[Edited by Moderator]
MacBook Pro 16″, macOS 11.6