Get the App
SLTechnology News&Howtos  ›  Servers  › 

One of the minor errors in AIX system-- Crontab failure

Shulou Source: shulou.com Published: 2022-06-02 07:18:41 09月20日 Update

AIX system minor error--Crontab fault

System environment:

Operating system: AIX 5.3.8

Oracle: Oracle 10gR2

Fault phenomenon:

Oracle users cannot enable crontab tools (other regular users also, root can)

[oracle@aix197:/var/adm/cron]$crontab -l

crontab: you are not authorized to use cron. Sorry.

Cause of failure:

Most of the files in/var/spool were deleted.

The cron directory under/var/adm was also deleted.

Solution:

Copy files from/var/spool and/var/adm/cron from other hosts to the corresponding directory on this machine

After copying, modify the corresponding file owner:

[root@aix197:/var/adm/cron]#cd /var/spool/cron/

[root@aix197:/var/spool/cron]#ls -l

total 16

drwxrwx--- 2 bin cron 512 Feb 20 15:38 atjobs

drwxrwx--- 2 bin cron 512 Jul 17 01:05 crontabs

[root@aix197:/var/spool/cron]#cd crontabs/

[root@aix197:/var/spool/cron/crontabs]#ls -l

total 32

-rw-r--r-- 1 adm cron 2020 Feb 20 15:38 adm

-rw-r--r-- 1 bin cron 0 Jul 17 01:05 oracle

-rw------- 1 root cron 2362 Jul 15 04:37 root

-rw-r--r-- 1 root cron 853 Feb 20 15:38 sys

-rw-r--r-- 1 root cron 1122 Feb 20 15:41 uucp

[root@aix197:/var/spool/cron/crontabs]#ls -l /var/adm

total 4976

drwxr-xr-x 2 root system 512 Jul 16 23:33 cron

drwxr-sr-x 2 sys sys 512 Jul 16 01:09 csd

-rw------- 1 root system 550 Jul 17 00:58 sulog

-rw-r--r-- 1 root system 2531736 Jul 17 00:59 wtmp

[root@aix197:/var/spool/cron/crontabs]#cd /var

[root@aix197:/var]#ls -ld adm

drwxrwxr-x 4 root system 512 Jul 16 23:33 adm

[root@aix197:/var]#chown bin:cron /var/adm/cron

Create cron.deny file:

[root@aix197:/var]#cd adm

[root@aix197:/var/adm]#ls

cron csd sulog wtmp

[root@aix197:/var/adm]#cd cron

[root@aix197:/var/adm/cron]#ls -l

total 72

prw------- 1 root cron 0 Jul 16 23:33 FIFO

-rw-r--r-- 1 root cron 33700 Jul 17 01:03 log

[root@aix197:/var/spool/cron/crontabs]#cat /var/adm/cron/cron.deny

cat: cannot open /var/adm/cron/cron.deny

[root@aix197:/var/adm/cron]#touch cron.deny

[root@aix197:/var/adm/cron]#chown bin:cron cron.deny

-- cron.deny content is empty!

[root@aix197:/var/adm/cron]#cat /etc/cron.allow

oracle

root

Note:

cron.deny Configure users denied access to crontab

cron.allow Configure users allowed to access crontab

Verification:

[oracle@aix197:/var/adm/cron]$crontab -l

[oracle@aix197:/var/adm/cron]$crontab -e

@ At this point, the problem is solved

Tags: File user fault system directory host copy configuration glitch normal operating system content reason most tools owner method environment phenomenon so far Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Xiaomi MariaDB NVidia Linux