LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   crontab (https://www.linuxquestions.org/questions/linux-newbie-8/crontab-505895/)

user52 11-29-2006 08:03 AM

crontab
 
hello sir...
i schedule my job on crontab but it is not running > why ?


my crontab like this.
05 * * * * /db/app/test.sh



here i have few question.
1.
if cronjob is fail where i see result... mean every cronjob send email. where i check.
2. i already check....

/usr/lib/ .... here no cron folder or not cron file..

actully i search cron.allow.... cron.deny...

plz. help....

matthewg42 11-29-2006 08:56 AM

cron will call syslog to report stats of cron jobs. Where syslog puts the messages depends on your exact setup. For me, cron status log messages go in /var/log/syslog, but you might have a cron specific logfile in your /var/log directory.

Often, cron will send a local email to the root user with cron errors. You'll only see this if you have local mail delivery configured so you get mails for root.

The quick-and-dirty method for seeing error messages would be to change the crontab line to:
Code:

05 * * * * /db/app/test.sh > /tmp/mycronlog 2>&1
...and wait for the program to run again, then look in /tmp/mycronlog.

General hint about cron problems: it's almost always because of the environment settings in general, the PATH variable in particular. When cron launches a job, it does so with a very restricted environment, as defined in the /etc/crontab file.

derxob 11-29-2006 05:24 PM

Make sure that the file you want executed has the correct "execute" permission.

chmod +x test.sh

user52 11-30-2006 01:11 AM

sir i give only like

chmod 755 test.sh it is right or wrong.
or i want to give
chmod +x test.sh

premission...

plz. sir help me...

matthewg42 11-30-2006 04:32 AM

Quote:

Originally Posted by user52
sir i give only like

chmod 755 test.sh it is right or wrong.
or i want to give
chmod +x test.sh

premission...

plz. sir help me...

They will both set the execute bit. Please read the chmod manual page to understand what each means.

venki 11-30-2006 04:38 AM

hi,

first u have to #/etc/filename.cron.
then 05 * * * * /db/app/test.sh
save it .
#crontab filename.cron

to check whether cronjob is running or not type crontab -l.

that's it!!

user52 11-30-2006 04:40 AM

hello sir thank for your reply

but #/etc/filename.cron.
sir which filename.cron...


crontab -l just show only content of file not status...


plz sir help me..

venki 12-08-2006 12:18 AM

u can give any filename...

/etc/backup.cron....this will create backup.cron file..

its very simple..
i too think this is hard ...but try u will get succeed
all the best


All times are GMT -5. The time now is 06:23 PM.