I have the following file /etc/cron.d/my_tasks and I would like to know how to set the environment variables within this file.
Previously I had it set up like this:
0 5 * * * root . /root/.profile path/to/my/task
But I would like to not have to explicitly have root set here, I would like to have something like:
0 5 * * * . $HOME.profile path/to/my/task
From what I have read though, Cron will not load the environment variables the same way for files inside cron.d as it would within /etc/crontab
Is it possible to load the environment variables in a similar way to what I am attempting?
Thanks