Issue with “date” command in MacOS Mojave

amrogers3

Gawd
Joined
Nov 7, 2010
Messages
575
I think this is a "Full Disk Access" problem.
I have added "Terminal" and "cron" to Full Disk Access.
Problem is when I am trying to use the below command, it works from Terminal but not with cron.

Code:
cp -n LastSession.plist  /XYZ/LastSession.plist.$(date +%F).txt

It works in cron if $(date +%F) is removed. It breaks in cron when I add $(date +%F). I believe I need to add date to Full Disk Access but I am not sure where it is located. I tried researching this but no luck.

How can I get this command to run in cron using Mojave?
 

amrogers3

Gawd
Joined
Nov 7, 2010
Messages
575
nm, got it figured out.

If anyone encounters the same issue, it is because you have to escape the % in cron so is should read like this:
Code:
cp -n LastSession.plist  /XYZ/LastSession.plist.$(date +\%F).txt
 
Top