Cronjob question about root emails.


 
Thread Tools Search this Thread
Operating Systems AIX Cronjob question about root emails.
# 8  
Old 11-26-2013
Can you share, what the actual output from the cron job looks like (what comes after the produced the following output:)?
# 9  
Old 11-27-2013
Code:
produced the following output:

/home/userid/userid/archive/filename.txt:     0.0% -- replaced with /home/userid/userid/archive/archive/filename.txt.gz


*************************************************
Cron: The previous message is the standard output
      and standard error of one of your cron commands.

?

That is pretty much all it says for all of them. The mail is coming from root I believe, and it states above that the standard output and error is being displayed. I thought I was suppressing them by adding /dev/null/ or adding the -v or adding MAIL=
# 10  
Old 11-27-2013
OK,
Let me ask you this, as root you are editing the crontab of other user? or you editing the crontab of root itself?
If your answer is former then I doubt the crontab will execute the script/command. If your answer is latter then, you should receive an email in root's inbox and NOT in other user's.
# 11  
Old 11-27-2013
Hmmm, aixnj, the output you shared is exactly, what gzip prints when executed with the -v option. But a few days ago, you said, that you removed this option from the crontab.

It seems, your change is not in effect. Did you edit the crontab with crontab -e? This is necessary to inform cron, that the crontab has been changed and needs to be reread. When you "just edit" the crontab file, cron does not reread it and keeps executing the old entry.
# 12  
Old 11-27-2013
Quote:
Originally Posted by ibmtech
OK,
Let me ask you this, as root you are editing the crontab of other user? or you editing the crontab of root itself?
If your answer is former then I doubt the crontab will execute the script/command. If your answer is latter then, you should receive an email in root's inbox and NOT in other user's.
The answer is neither. In my case this is another user on the box, and I'm editing that users crontab logged in as that other user, which we want to run it under that user's name of course. So really not using root here, but if you can see from some of the mail I put in this thread, to me at least, seems root is sending the mail about the other user's crontab jobs. We really dont need that.

Quote:
Originally Posted by hergp
Hmmm, aixnj, the output you shared is exactly, what gzip prints when executed with the -v option. But a few days ago, you said, that you removed this option from the crontab.

It seems, your change is not in effect. Did you edit the crontab with crontab -e? This is necessary to inform cron, that the crontab has been changed and needs to be reread. When you "just edit" the crontab file, cron does not reread it and keeps executing the old entry.

Ah, guilty as charged. You were right, the change never took. I did user the crontab edit command to make changes. I even killed the cron process, even though I know it auto spawns. But now I triple checked and it seems to have taken my edit so I'll see how it runs tonight. Mind you I now have:

Added
Code:
MAILTO=

Added
Code:
>/dev/null

Removed
Code:
-v

# 13  
Old 12-10-2013
Just wanted to confirm that your suggestions worked. Thanks guys. Smilie

Moderator's Comments:
Mod Comment edit by bakunin: I'm glad it worked. I set the threads title to SOLVED.

Last edited by bakunin; 12-11-2013 at 10:15 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Execute Ubuntu 14.04 cronjob as non-root

I have created a cronjob that successfully executes and among other thing runs aria2c to download several files and save them to a folder. However, since it executes as sudo, the downloaded folder is saved with those permissions. Is there a way to execute the cronjob so that the downloaded folder... (4 Replies)
Discussion started by: cmccabe
4 Replies

2. Shell Programming and Scripting

Cronjob for root password change.

Hi, I am writing a cronjob which changes default root password to some designated password(set) after 15 days. The requirement for same is because i need to give application team root access for first 15 days, but after that the default password should be changed, now I want to automate the... (3 Replies)
Discussion started by: nixhead
3 Replies

3. Solaris

Migration of system having UFS root FS with zones root to ZFS root FS

Hi All After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Discussion started by: sb200
2 Replies

4. Shell Programming and Scripting

Question about cronjob

Dear all, I wrote a script and set it as a cron job to automatically download the data from the website. Here is the problem, when I run this script in terminal, it works well, while it can not download the files when I run it as a cron job, I feel so weird. The script as follows:... (28 Replies)
Discussion started by: handsonzhao
28 Replies

5. Solaris

Simple question: alias not working for root

OS = Solaris 8 Issue: alias not working for root, but working for regular users # grep root /etc/passwd root:x:0:1:Super-User:/:/sbin/sh # alias dir=ls # dir dir: not found # alias dir="ls -l" # dir dir: not found # alias dir='ls -l' # dir dir: not found # alias... (2 Replies)
Discussion started by: aixlover
2 Replies

6. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

7. Shell Programming and Scripting

Question on Verifying root's current directory

From a script how would I verify that the current directory (.) is not in root's path. Now when the script is going to be run the auditor wil not be signed in as root, but rather running it via sudo, so I'm thinking the standard $path won't work for that case. Derek:confused: (3 Replies)
Discussion started by: sport
3 Replies

8. UNIX for Dummies Questions & Answers

? question mark, how to get back to the root directory

hiyas I am trying to get back to the root directory: I went into MAIL directory and now I can't get back to the root directory. What are the commands... I have '?' coming up and I cannot proceed with this, HELP Cheers (1 Reply)
Discussion started by: etravels
1 Replies

9. UNIX for Dummies Questions & Answers

Root login question

Hi all I am administering Linux boxes (running rehat linux 7.3 and 8.0). The other day I tried to ssh from 1 linux box to the other. I was root on the client box. Surprisingly, I could login as root into the host after giving the password!! I am unable to get root login from a SSH client... (2 Replies)
Discussion started by: skotapal
2 Replies

10. UNIX for Dummies Questions & Answers

Cronjob question

Hi folks! I set up a cronjob yesterday to excute this morning at 4am. The problem I am experiencing is that the script that is executed cannot find specified files which it is suppose to run like my file.sql and other various scripts which are in the same directory as the exucutable script. ... (4 Replies)
Discussion started by: maverick
4 Replies
Login or Register to Ask a Question