Go Back   The UNIX and Linux Forums > Operating Systems > AIX


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-14-2006
Registered User
 
Join Date: Nov 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
crontab in AIX

Hi all, i am trying to reduce the file size of /var/adm/wtmp in my AIX servers and im using the method cp /dev/null /var/adm/wtmp to reduce it. I thought of automating it by including this command into crontab. Surprisingly, it doesn't work once i put into crontab, there is no error message thrown out, no messages, no output in fact it seems as though that command was not executed at all. How come? I tried typing manually the command and it works it only doesn't work in crontab. Any suggestion?
Sponsored Links
    #2  
Old 11-14-2006
Registered User
 
Join Date: May 2006
Location: England
Posts: 404
Thanks: 7
Thanked 7 Times in 7 Posts
Please give an example of the entry from the crontab. I bet it is because you are not using the absolute path of cp as in /usr/bin/cp.
Sponsored Links
    #3  
Old 11-14-2006
Registered User
 
Join Date: Nov 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
I tried with full path and it doesnt work too. By the way the command i use is:

1 * * * * /usr/bin/cp /dev/null /var/adm/wtmp

THe reason i let it run every minute is because at this moment i want to monitor hence a 1 minute wait is the most appropriate.
    #4  
Old 11-14-2006
Registered User
 
Join Date: May 2006
Location: England
Posts: 404
Thanks: 7
Thanked 7 Times in 7 Posts
No wonder /usr/bin/cp /dev/null > /var/adm/wtmp
Sponsored Links
    #5  
Old 11-14-2006
Registered User
 
Join Date: May 2006
Location: England
Posts: 404
Thanks: 7
Thanked 7 Times in 7 Posts
I am wrong now disregard my last entry!
Sponsored Links
    #6  
Old 11-14-2006
Registered User
 
Join Date: May 2006
Location: England
Posts: 404
Thanks: 7
Thanked 7 Times in 7 Posts
Try /usr/bin/cat /dev/null > /var/adm/wtmp
Sponsored Links
    #7  
Old 11-14-2006
Registered User
 
Join Date: Nov 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
How come i need to add the > but via command line i do not need to use that? How often will it update the log file for cron? Once i've modified i do not see it in the /var/adm/cron/log file immediately. It still doesn't work after i did that:

1 * * * * /usr/bin/cp /dev/null > /var/adm/wtmp
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab help plz chakkaravarthy Shell Programming and Scripting 2 12-15-2010 05:13 AM
Crontab and PHP help Sidabm Shell Programming and Scripting 8 12-31-2009 04:04 PM
crontab Pouchie1 Shell Programming and Scripting 3 12-20-2009 01:17 AM
Crontab RAFC_99 UNIX for Dummies Questions & Answers 4 11-30-2009 05:17 PM
ftp and crontab user` Shell Programming and Scripting 27 11-13-2006 07:02 PM



All times are GMT -4. The time now is 01:55 AM.