System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to edit or list crontab

 
Occasional Visitor

Unable to edit or list crontab

Hi

 

I have a system running hp-ux 11.23, which I am not able to edit or list crontab, but previously this was possible.

cchost0[347]/var/adm/cron #/sbin/init.d/cron stop
cron stopped
cchost0[349]/var/adm/cron #/sbin/init.d/cron start
cron started
cchost0[350]/var/adm/cron #crontab -l
cchost0[351]/var/adm/cron #crontab -e
cchost0[352]/var/adm/cron #ps -ef | grep cron
    root  4287  4233  0 09:51:04 pts/4     0:00 grep cron
    root  4282     1  0 09:50:35 ?         0:00 /usr/sbin/cron

I have check the logs,:

tail OLDlog
>  bscsprod 4192 c Fri Oct  2 09:30:00 SAST 2020
>  CMD: /sbin/rc3.d/VPN_ping > /dev/nulll 2 >&1
>  root 4193 c Fri Oct  2 09:30:00 SAST 2020
<  pprov 4190 c Fri Oct  2 09:30:00 SAST 2020 rc=1
<  bscsprod 4192 c Fri Oct  2 09:30:00 SAST 2020 rc=1
<  root 4189 c Fri Oct  2 09:30:00 SAST 2020
<  root 4193 c Fri Oct  2 09:30:28 SAST 2020 rc=2
>  CMD: /sbin/rc3.d/VPN_ping > /dev/nulll 2 >&1
>  root 4261 c Fri Oct  2 09:45:00 SAST 2020
<  root 4261 c Fri Oct  2 09:45:28 SAST 2020 rc=2

 

and:

tail log
! *** cron started ***   pid = 4282 Fri Oct  2 09:50:35 SAST 2020
>  CMD: /sbin/rc3.d/VPN_ping > /dev/nulll 2 >&1
>  root 4308 c Fri Oct  2 10:00:00 SAST 2020
>  CMD: /fs1/bscsprod/BSCS_iX/WORK/PPROV/EMM/msisdn.sh > /fs1/bscsprod/BSCS_iX/WORK/PPROV/EMM/cronlog
>  pprov 4309 c Fri Oct  2 10:00:00 SAST 2020
>  CMD: /fs1/bscsprod/BSCS_iX/WORK/backup/monitor_dbdump.sh > /fs1/bscsprod/BSCS_iX/WORK/backup/bdf.log 2>&1
>  bscsprod 4311 c Fri Oct  2 10:00:00 SAST 2020
<  pprov 4309 c Fri Oct  2 10:00:00 SAST 2020 rc=1
<  bscsprod 4311 c Fri Oct  2 10:00:00 SAST 2020 rc=1

other files:

tail cron.allow
root
adm
uucp
pprov
ccuser

 

#more queuedefs
a.4j1n
b.2j2n90w
queuedefs: END

Please what possible could be wrong....

7 REPLIES 7
Honored Contributor

Re: Unable to edit or list crontab

What does this command show?

# ls -l /var/spool/cron/crontabs

 



Bill Hassell, sysadmin
Occasional Visitor

Re: Unable to edit or list crontab

Hi

Thanks for the reply, the output of that command is:

ls -l /var/spool/cron/crontabs
total 64
-r--------   1 root       107            228 Sep  9  2009 bscsprod
-r--------   1 root       oinstall       732 Nov  1  2009 ora10g
-r--------   1 root       users          242 Jan 15  2008 pprov
-r--------   1 root       sys            767 Nov  4  2010 root
Honored Contributor

Re: Unable to edit or list crontab

What does your 'crontab' command look like?

This is from an 11.11 system, but the permissions and ownership should be similar though the file size / date will differ.

 

root@prod1:/
# which crontab
/usr/bin/crontab
root@prod1:/
# ll /usr/bin/crontab
-r-sr-xr-x 1 root bin 28672 Aug 24 2006 /usr/bin/crontab

Honored Contributor

Re: Unable to edit or list crontab

Try restarting cron:

# /sbin/init.d/cron stop
# /sbin/init.d/cron start

Then try the cron -l command again.

 



Bill Hassell, sysadmin
Occasional Visitor

Re: Unable to edit or list crontab

The output of the commands:

#which crontab
/usr/bin/crontab
#ll /usr/bin/crontab
-r-sr-xr-x   1 root       bin              0 Dec 22  2009 /usr/bin/crontab

 

Occasional Visitor

Re: Unable to edit or list crontab

I did try stop and start the cron job before, but nothing happens:

/sbin/init.d/cron stop
cron stopped
cchost0[133]/ #/sbin/init.d/cron start
cron started
cchost0[134]/ #crontab -l
cchost0[135]/ #date
Tue Oct  6 08:35:18 SAST 2020
cchost0[136]/ #
Honored Contributor

Re: Unable to edit or list crontab

Well, here's your problem.

#ll /usr/bin/crontab
-r-sr-xr-x   1 root       bin              0 Dec 22  2009 /usr/bin/crontab

 

Somehow your crontab executable has been wiped out.  It is zero bytes.  That will definitely not work.

 

You need to restore it from a backup.