- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- cron job error
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2008 11:54 PM
тАО01-30-2008 11:54 PM
I have inherited a Tru64UNIX system.
One of the cronjobs that it runs is:-
find /var/adm/syslog.dated/* -depth -type d -ctime +7 -exec rm -rf {} \;
Whenever this job runs root gets an e-mail with the error message - find: arg list too long
Is it possible that someone can advise where the error in this command is?
I have tried the man pages for find, and they seem to be a bit ambiguous.
Thanks
Andy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2008 01:12 AM
тАО01-31-2008 01:12 AM
SolutionThis is happening because there are too many files in the directory /var/adm/syslog.dated
You can usually get around it by using perl, rather than the rm, so something like this should work (although I haven't got a system to test on at the moment).
find /var/adm/syslog.dated/* -depth -type d -ctime +7 | perl -nle 'unlink;'
Hope this helps,
Regards,
Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2008 02:25 AM
тАО01-31-2008 02:25 AM
Re: cron job error
ROb is perfect.This error is because you have a lot of files in var/adm/syslog.dated/
#ls -lrt /var/adm/syslog.dated|wc
generally syslog.dated does not have files for more than some days,u can go and delete old files,may be 500 at a time.
#find /var/adm/syslog.dated/* -depth -type d -ctime +7|head 500|xargs rm
BR,
Kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2008 02:26 AM
тАО01-31-2008 02:26 AM
Re: cron job error
and see/tell what kind of files are accumulating.
BR,
Kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2008 04:43 AM
тАО01-31-2008 04:43 AM
Re: cron job error
find /var/adm/syslog.dated/* -depth -type d -mtime +7 -exec rm -rf {} \;
Probably that is why you have too many directories.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2008 05:26 AM
тАО01-31-2008 05:26 AM
Re: cron job error
The shell expands "/var/adm/syslog.dated/*",
and the result is "too long".
Why not use
find /var/adm/syslog.dated [...]
instead of
find /var/adm/syslog.dated/* [...]
?
You might need to do something special to
avoid deleting the whole tree (when it
considers "/var/adm/syslog.dated" itself),
but that should be easy enough.
Using wildcard file specifications ("*")
always runs the risk of seeing too many
files.
> [...] may be 500 at a time.
> [...] |head 500| [...]
That's a bit too late, isn't it? "find" is
complaining, not "rm" (or the shell).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2008 01:16 AM
тАО02-01-2008 01:16 AM
Re: cron job error
You can set exec_disable_arg_limit to 1 into proc subsystem to disable limit on the number of arguments that a command can have when it executes. It is recommended that you set exec_disable_arg_limit to 1.
see man sys_attrs_proc for exec_disable_arg_limit.
VINCENT Jean-Marc
HP France
Groupe Support Unix
Tru64(tm) UNIX Technical Consultant - Tru64(tm) UNIX Ambassador HP France
+33 1 5762-8861
jean-marc.vincent@hp.com
├п Think before you print