1752701 Members
6461 Online
108789 Solutions
New Discussion юеВ

Re: crontab !!

 
Faisal Aljundi
Frequent Advisor

crontab !!

Hi,

i'm working on Openview and I know Sun solaris OS, not i'm not expert with HP-UX and I have HP-UX 11.

my Question is:
when I want to see the crontab I did the follwoing:

# crontab -l
crontab: can't open your crontab file.
#

why I can not open my crontab file ????

thanks
Faisal
2 REPLIES 2
Faisal Aljundi
Frequent Advisor

Re: crontab !!

Sorry every one, but I found the solution

Becasue there is no any cron job inside it.:)

This is different than Solaris :)

Assign to myself [ -10 point ] hehe.

regards
Faisal
eran maor
Honored Contributor

Re: crontab !!

Hi

you are getting this error message becuase the user that you are oper. dont have the crontab file .

if you want to add a crontab file to the user
you first need to modify the file /var/adm/cron/cron.allow to add all the user that can oper. the crontab .

adter that you can create a crontab file with the command : crontab -e

and after that if you want to see the crontab
you can oper the comand : crontab -l username

but the error message that you are getting is telling that the dir. /var/spool/cron/crontabs to see which user has create a crontab file

you can also denny access to user that you dont want them to use the crontab with editing the file /var/adm/cron/cron.denny .

also here is some general info about crontab

1. Submit jobs with:

crontab cronfile

2. Remove jobs with:

crontab -r

3. Modify jobs with:

crontab -l > /tmp/cronfile
vi /tmp/cronfile
crontab /tmp/cronfile

NOTE: As of 10.20, crontab -e can be used to edit a users crontab entries.



To clear up the situation, do these steps at a time when the system can be rebooted,
or the cron deamon can at least be stopped and restarted:

1. Login as the user who runs the cronjobs.

2. Execute the following:

crontab -l > /tmp/cronfile

3. Remove the scheduled jobs:

crontab -r

4. Execute:

crontab /tmp/cronfile

If the problems persist, kill and restart the cron daemon with these two commands:

/sbin/init.d/cron stop
/sbin/init.d/cron start
love computers