Hi all,

I am trying to run a cron job on kernel 2.6.18-8.1.1.lspp.73.el5, but it
is not being executed. 

Environment - 
kernel-2.6.18-8.1.1.lspp.73.el5
crontabs-1.10-8
vixie-cron-4.1-67.el5
selinux-policy-mls-2.4.6-55.el5
selinux-policy-2.4.6-55.el5
audit-1.3.1-4.el5

I am trying to do the following -
1) run_init /etc/init.d/crond restart
2) add a cron job as follows 
crontab - << EOF
`date '+%M' | awk '{ print ($1+2)%60 " * * * * "
}'` <path to exec>/a.out
EOF
where a.out is the following compiled c program -

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

main()
{
        int fd, n;
        char *buf="this is a piece of text\n";
        n = strlen(buf);
        if ( (fd = open("a.txt", O_RDWR, O_CREAT | O_TRUNC)) < 0)
                perror("open");
        else if( write(fd, buf, n) < n )
                perror("write");
        close(fd);
}

The modification time of a.txt does not change after the cron job is
supposed to have run. 

I do understand that there are better ways of doing this. But the issue
here is that cron is not running jobs in the above mentioned
environment.

What could be the problem here?

Thanks,
Raghuveer

--
redhat-lspp mailing list
[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-lspp

Reply via email to