Env:- Ubuntu 18.04
I write one C program and trying to speak to port and fetch some data and dump into one file. Then I created one bash script and added this C program and expect to run at multiple intervals.
I'm able to run this bash script without any issues. I'm running as root.
<<snip>>
#!/bin/bash
interval=$1
time=$2
./CC-test $interval $time
<<snip>>
May I know is there any permission delegation issue for invoking some commands via cron? or do we need to tell cron to excecute with administrative privilege? Anyway I'm running cron as root, then I don't think so, if anything other required.
As a test, I just tried two commands in a shell script as follows
#!/bin/bash
date >> test
fdisk -l >> test
Even here also I can able to run manually and even both output is printing without any issues. For here I put it is in cron, on the "date" command output which is printed in test file.
Please shed me some views on this.
env -i ./testscript
- this can frequently show hidden problems that don't show when run from the command line but may show when run from cron.