Hi all! So I've been trying to create a cron job to output CPU temperature and a timestamp to a text file for logging. I have the following script written, and the commands work as expected when run in the shell separately, but when run in the cron job, the output for DATE goes into a file named C3HSBO~G and the output for the core temps goes into the expected file. Any ideas as to why this would be occurring?
Code:
#!/bin/bash TODAY=$(date) echo $TODAY >> '/mnt/HomeNAS/shared/NAS Documentation/CPU.txt' sysctl -a |egrep -E "cpu\.[0-9]+\.temp" >> '/mnt/HomeNAS/shared/NAS Documentation/CPU.txt'