Script does not run from a user specific cronjob.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Script does not run from a user specific cronjob.
# 1  
Old 04-05-2013
Script does not run from a user specific cronjob.

Hello,

I have two crontabs, one for the root and one for another user. There is a script in my configurations that has to send a email. The script works and sends the emails when I run it by hand with either the root or the user, and when I program it in the root's crontab.
But! It does not work when I program it in the user specific crontab....

Any ideas to know why this is not working?
# 2  
Old 04-05-2013
can you pls share the program that you have given in the root's crontab?
# 3  
Old 04-05-2013
Thank you for answering!The script it is not important as It has been proved that it works, however I want to add something that I have just noticed.

My scripts is just a simple one that calls 3 others lets call it test.sh inside it has:
first.sh
second.sh
send_results.sh

If I program it test.sh inside the crontab it does not send the email. But If I program send_results.sh outside test.sh, directly into the crontab It does.

Any ideas? Thanks in advance!
# 4  
Old 04-06-2013
cron, when running scripts/commands, has a minimal environment. You need to assign important variables like PATH etc. Search these fora for frequent errors with cron jobs.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Set script to run during specific times

Hi all, I have this script which sends mail whenever the system is down. It works fine. Normally the system is down from 21 00 to 21 30 from Monday to Saturday and from 21 00 on Sunday to Monday 06 00 for maintenance. So I want the below script to run only when the system is up, i.e outside the... (2 Replies)
Discussion started by: frum
2 Replies

2. Shell Programming and Scripting

Schedule and Run By weekly shell script in cronjob

Hi All, How to schedule a shell script(script name- byweeklyreport.sh) it should run by weekly in corn job or is there any script have to write to check week and then run the above script. example-1st run March 06 2013 2nd run March 20 2013 3rd run April 3 2013... (13 Replies)
Discussion started by: krupasindhu18
13 Replies

3. Shell Programming and Scripting

Script to run commands at a specific time.

Hello All, I have written a script which which is working fine to a certain logic of it. But i want a part of the script to run two commands at 00:10 hrs every day. These two command are 1. rm -rf /path/to/folder 2. mail the content of a file. How do i achieve this. Thanks. ... (4 Replies)
Discussion started by: Siddheshk
4 Replies

4. Shell Programming and Scripting

shell script that will run for a specific date

Hi, I have these changes needed to modify a shell script that will run on a specific date of a month, below pseudocode, appreciate any answers..thanks.. if date of the month is 26th then ..event 1 fi if date of the month is 26th and month are MAR,JUN,SEP,DEC then ..event2 ... (7 Replies)
Discussion started by: sonja
7 Replies

5. AIX

My script didn't run every run every minute at cronjob

In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all. * * * * * script.sh When I run it manually, I can run it. Is that anything wrong with the above line? If I change it to something like below,... (4 Replies)
Discussion started by: ngaisteve1
4 Replies

6. Shell Programming and Scripting

Doesn't run as a cronjob...

Hi! I have a svn backup script that works perfectly if I execute it from the command line but if I set it as a cronjob to run at night, only part of the code works. So, basically the scripts starts by deleting the folder yesterday and then moves the folder today to the folder yesterday. When... (4 Replies)
Discussion started by: ruben.rodrigues
4 Replies

7. Shell Programming and Scripting

Running script that sends an html formatted email fails when its run as cronjob

Hi Im very new at working with unix and this problem I simply can not understand. I know there are a lot of threads about problems with shell scripts behaving differently when run from a terminal and from a cronjob. I have tried everything(almost) but I still havent cracked this problem. Im... (15 Replies)
Discussion started by: Nightowl
15 Replies

8. UNIX for Dummies Questions & Answers

cronjob to run perl script

Hi all Recently i had finished a perl script. When i run manually, the script work fine. But when i wanted to put the script in cron, it didn't get the same output as it run manually. I felt that it only execute the script until certain line then it stop as i see most of the related files didn't... (6 Replies)
Discussion started by: AirWalker83
6 Replies

9. Solaris

How to run a script as different user inside cronjob in solaris.

Hi , I have a shell script to perform some actions on sun solaris box . This script normally requires to be run as a different user. so, whenever i have to run this script, i need to sudo in as that user , enter the password and execute it. Now,I have to setup a cronjob to execute the script... (11 Replies)
Discussion started by: csg_user
11 Replies

10. UNIX for Advanced & Expert Users

cannot run cronjob

I have the following cron: 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /v/sysadmin/sysnet/file.pl The .pl has been tried at 755 and 777 The script works if manually run by the web browser or unix command prompt, but I can't get the Cron to do it automatically i went... (3 Replies)
Discussion started by: shahrahulb
3 Replies
Login or Register to Ask a Question