Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about command difference crontab vs command line with find and exec rm 2

Status
Not open for further replies.

appi

IS-IT--Management
Mar 17, 2003
296
CH
Hi all

I just checked previousl posts, but not find what I am looking for.
I have a command running on AIX 6.1 TL6 to delete NMON Files older than 7 days

/usr/bin/find /var/adm/nmon_data -mtime +7 -exec rm {} \;

If I fire this command on command line it works fine, to be sure I tried ksh, sh (which is default for root) and bash,
but I want to run this with crontab
47 16 * * 4 /usr/bin/find /var/adm/nmon_data/ -mtime +7 -exec rm {} \;

It wil not work and sends a mail for root with :

Your "cron" job executed on xxxxx on Thu Jan 9 16:47:00 CET 2014
/usr/bin/find /var/adm/nmon_data -mtime +7 -exec rm {} ;


produced the following output:

find: 0652-018 An expression term lacks a required parameter.


What I need to set up ? On Solaris this works fine

regards
appi
 
Thanks Frederico

this works now on AIX 6.1. But I do not understand why .... On Solaris Double Backslash give an error.

regards
appi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top