I have a simple backup script with this line to come up with a name for the backup:
It works great when I run it under the root user. Unfortunately when I set it to run as a cronjob, the $(hostname) part is always empty and I don't get the hostname. Why isn't it working, and how can I get the hostname in a cron job?
I'm running ubuntu 18.04