Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CRON won't run system commands (even as root)

Posted on 2002-03-18
2
Medium Priority
?
187 Views
Last Modified: 2013-12-15
hi. I am trying to figure out why CRON *will* execute this script, but it won't actually do what it's supposed to do.

here's a copy of a simple script (/usr/local/bin/shelltest):

#!/bin/sh
groupadd mytest22



Here's my crontab file:
[root@internetsubmit internetsubmit]# crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.24499 installed on Tue Mar 19 01:14:24 2002)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
13 * * * * /usr/local/bin/shelltest


when I install as root into CRON, it will not create the group "mytest22" but if i run the script from the command line, it works fine. I've tried this on two systems (Redhat & Mandrake) and nothing. There must be something about CRON that I am overlooking...perhaps it has a safety feature?? Anyone know how to fix it so I can create users/groups into the system using CRON?


Thanks!
0
Comment
Question by:linuxnewbie7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 400 total points
ID: 6879211
you need to use a full path to groupadd
Also see the crontab user's mail, 'cause cron sends a mail if it fails.
0
 

Author Comment

by:linuxnewbie7
ID: 6879228
yes, I just figured that out too! Thanks! It works when used the full path
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question