Hay there fediverse. Do we have any #bash #cron experts that can help me figure out how to fix things?
TL;DR - I need to reference the `$USER` variable as a parameter in a shell script that forms part of a dynamic path in a backup routine (the location varies by host so trying to automate as much as possible). Running the script as a logged in user over SSH works perfectly but when I add a crontab entry under the same user to run the same script is fails to parse the `$USER` part so the destination is incorrect and it throws an error.
I should also note that if I specify the path manually in the script it also works, but then it's a pain to automate across different hosts so I'm trying to avoid that if possible.
I now been going round in circles trying to figure this out for a couple of days so it's time to ask for help.