I tried setting up a crontab on my Mac, but it's not running for some reason.
Here's what I'm trying to run:
*/2 * * * * /BackupScript/backup.sh
I have it set to every 2 minutes currently for testing purposes. When I add
>> /BackupScript/log.log
to the cron task, it never writes anything to the file, merely creates a blank file. I should add that the script works fine when ran manually.
Where am I going wrong?
2>&1
at the end of the cron task (in addition to the log redirect) to catchstderr
too.stdout
works fine for me on a script that contains simply the commanddate
; anystderr
is sent to/var/mail/$USER
. Have you tried running a trivial script like that instead of your actual script?