The system()
function does not work when the program is run from a cron job, but it works fine when I manually execute the program.
C Code:
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char command[256];
strcpy(command, "mpg123 /home/vlad/MIA/Alarm/test.mp3");
printf("Commnd Executed");
system(command);
return 0;
}
Crontab File:
*/1 * * * * /home/vlad/MIA/Alarm/test >> /home/vlad/MIA/debug_test.txt