Score:0

.NET CORE as a cron job is failing

dj flag

I've gotten this working (different .NET core app but also .net 6.0). However deploying a new app to a new server and... problems are as follows:

I can run app: ./ApplicationName

I can put the app in a bash script and execute the script. I.e. /var/apps/scripts/runmyapp.sh

Running either of these manually is not a problem. However when I schedule them in crontab (either sudo or my user) they do not run. I know the formatting of the schedule is correct because I'm executing other commands (i.e. moving files to be processed).

Both the Application and the bash script are marked as executable and I have tried combinations of giving ownership to these files (chown) to both root and the local user. I can see in /var/log/syslog that the command / script is being executed... but... no other log is... logged. I have a sqlite db that would show logs. And when I run app manually everything executes.

hr flag
Presumably your sqlite db will only show logs if the application actually runs - to capture more fundamental errors, try adding something like `>/tmp/runmyapp.log 2>&1` to your crontab entry
Score:0
dj flag

Turns out this was as simple as a script spelling error. Unfortunately cron log showed the script call but didn't provide any detail that this script didn't actually exist. After having a team member review he uncovered the oversight. Pretty stupid on my part but just have to remember to be extra diligent with these things from now on.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.