Hi all, I am having a big problem and I have no idea what else can I do to solve it...
I created a NetCore application that reads and saves in a file some hardware information using dmidecode commands.
I deployed my application in a CentOS server, and assign it execution permissions by using the following command:
Code:
chmod 777 ApplicationFolder/AplicationName
Now, when I execute my application I get a log file with the information I asked. My problem is when I set my application to be executed with crond.
For that, I ran the command:
And inserted the line:
Code:
* * * * * /ApplicationFolder/ApplicationName
After some seconds my log file is created, when I check it out it contains the information I ask except the one retrieved by the execution of dmidecode commands.
I am assuming that its a permission problem because the application is working fine when executing via command line.
After some research, I have also discovered that dmidecode requires sudo privileges... but I executed crontab -e with the root account, so I should have the right privileges right?
These are some things I tried:
- Add the user account root to the crontab line (nothing happens, no file generated)
- Changed the permisions of the file dmidecode in /usr/sbin/ with the command chmod 777 but the same happens (no output from dmidecode commands)
- Changed the application internal commands to run sudo before the dmidecode commands (no output from dmidecode commands)
- Created the cron job by adding it to the file /etc/cron (nothing happens)
I don't know what else I can do. Anyone knows what I am doing wrong? Or what else can I attempt to do?