My script which starts a process and writes the PID of that process to file. This works as it's supposed to when I execute it from shell:
process & echo $! > /home/xxx/PIDs/process.pid
But when I let cron do that, the process is executed but the PID file is missing. This is weird to me. What could be wrong?
The cronjob is a simple
@reboot trigger. I tried, as Jeff Schaller mentioned,
*/10 * * * * /home/xxx/bin/process & echo $! > /home/xxx/PIDs/process.pid
but this does not work.