deklinm
asked on
Crontab Problem
When i try to run crontab -l from the root log prompt in i am told it is not available
However, if i navigate to /etc/crontab its there
Most of my servers respond to the crontab -l command when at the root login prompt. Is there something i need to install to get the rest of the servers to work this way?
However, if i navigate to /etc/crontab its there
Most of my servers respond to the crontab -l command when at the root login prompt. Is there something i need to install to get the rest of the servers to work this way?
try to see whether the cron folder is in your path enviroment variable
http://en.wikipedia.org/wiki/Environment_variable
http://en.wikipedia.org/wiki/Environment_variable
ASKER
Below is what happens when i try to run crontab -l
[root@server3 ~]# crontab -l
-bash: crontab: command not found
[root@server3 ~]# crontab -l
-bash: crontab: command not found
/etc/crontab
is the system crontab, not root's crontab!
is the system crontab, not root's crontab!
Issue command
/bin/crontab
/bin/crontab
Your root user probably doesn't have /bin in its path OR you did
su
instead of doing
su -
su
instead of doing
su -
crontab folder should be in path variable or you have to write the full path to the crontab -l
http://www.math.iitb.ac.in/resources/manuals/Unix_Unleashed/Vol_1/toc.htm
http://www.math.iitb.ac.in/resources/manuals/Unix_Unleashed/Vol_1/toc.htm
ASKER
Results
[root@server3 ~]# /bin/crontab
-bash: /bin/crontab: No such file or directory
[root@server3 ~]# /bin/crontab
-bash: /bin/crontab: No such file or directory
ASKER
No i am getting permission denied.
I am logged in as root.
[root@server3 ~]# /etc/crontab
-bash: /etc/crontab: Permission denied
I am logged in as root.
[root@server3 ~]# /etc/crontab
-bash: /etc/crontab: Permission denied
NO
I SAID BIN NOT ETC
/bin/crontab
If this still doesn't resolve the problem:
Please issue command
rpm -q cronie
If you don't have this RPM install it by issuing command
yum -y install cronie
I SAID BIN NOT ETC
/bin/crontab
If this still doesn't resolve the problem:
Please issue command
rpm -q cronie
If you don't have this RPM install it by issuing command
yum -y install cronie
ASKER
[root@server3 ~]# rpm -q cronie
package cronie is not installed
[root@server3 ~]# yum -y install cronie
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.corenetworks.net
* extras: mirror.sanctuaryhost.com
* updates: mirror.serversurgeon.com
Setting up Install Process
No package cronie available.
Nothing to do
package cronie is not installed
[root@server3 ~]# yum -y install cronie
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.corenetworks.net
* extras: mirror.sanctuaryhost.com
* updates: mirror.serversurgeon.com
Setting up Install Process
No package cronie available.
Nothing to do
The User's Shell Startup File: .profile Under each Bourne shell user's home directory is a file named .profile. This is where a system administrator or user (if given write permission) can make permanent modifications to his shell environment. To add a directory to the existing execution path, just add the following as line into .profile.
PATH=$PATH:/sql/bin ; export PATH
PATH=$PATH:/sql/bin ; export PATH
Sorry, on Centos it is
/usr/bin/crontab
I was on Fedora.
/usr/bin/crontab
I was on Fedora.
ASKER
[root@server3 ~]# /usr/bin/crontab
-bash: /usr/bin/crontab: No such file or directory
-bash: /usr/bin/crontab: No such file or directory
However, cronie is the correct package for CentOS
Ok, looks like you really don't have this package installed and you don't seem to have it from yum either. Do you have CD/DVD?
ASKER
ok..i got crontab installed using the code below
yum install vixie-cron crontabs
/sbin/chkconfig crond on
/sbin/service crond start
Now i am receiving an error that states
[root@server3 ~]# crontab -l
no crontab for root
yum install vixie-cron crontabs
/sbin/chkconfig crond on
/sbin/service crond start
Now i am receiving an error that states
[root@server3 ~]# crontab -l
no crontab for root
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also issue command
chkconfig crond on
So that it stays on after reboot.
chkconfig crond on
So that it stays on after reboot.
Login as the adm user and use crontab -e to edit the crontab file to activate the daily accounting functions. By editing the /var/spool/cron/crontabs/a dm file, you are allowing cron to control the periodic collection and reporting of statistical data. See the example of the crontab entries for runacct, dodisk, ckpacct, and monacct below:
10 23 * * 0-6 /usr/lib/acct/runacct 2>/usr/adm/acct/nite/accte rr > /dev/null
0 23 * * 0-6 /usr/lib/acct/dodisk > /dev/null 2>&1
0 * * * * /usr/lib/acct/ckpacct > /dev/null 2>&1
15 4 1 * * /usr/lib/acct/monacct > /dev/null 2>&1
10 23 * * 0-6 /usr/lib/acct/runacct 2>/usr/adm/acct/nite/accte
0 23 * * 0-6 /usr/lib/acct/dodisk > /dev/null 2>&1
0 * * * * /usr/lib/acct/ckpacct > /dev/null 2>&1
15 4 1 * * /usr/lib/acct/monacct > /dev/null 2>&1
/var/spool/cron
folder
Take a look, I didn't have any cron entry and the I created an entry.
[root@labvm3 ~]# crontab -l
no crontab for root
[root@labvm3 ~]# ls /var/spool/cron/
[root@labvm3 ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@labvm3 ~]# crontab -l
* * * * 1 echo "***"
[root@labvm3 ~]# ls /var/spool/cron/
root
So the file is
/var/spool/cron/root
You are looking at the system file.