The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab a Script moutaz1983 Shell Programming and Scripting 6 01-16-2008 10:35 AM
Temporarily disable effect of set -e in ksh ugeek Shell Programming and Scripting 1 03-28-2007 04:21 AM
How do properties effect script? Chiefos UNIX for Dummies Questions & Answers 1 06-21-2006 06:23 AM
Effect of Preemptive Kernel sriram.ec UNIX for Advanced & Expert Users 2 03-15-2006 01:43 AM
recursive effect!! sskb UNIX for Dummies Questions & Answers 2 01-30-2003 12:05 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-05-2007
thepurple thepurple is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 134
will this script in crontab effect SUN 9??

Hi all,

I work in Sun Solaris 9. I am plan to put the following script(remove90dysOldrfiles.sh) in CRONTAB for removing huge huge number of files those are older than 90 days from different directory.
In the Crontab i will set the time for everymidnight it will search 90days older file and remove it from system.

But my confusion is how the Following script will work is it Like- every command for find and remove will execute one after another or parallel processing could be happen. If parallel processing could be occur than i scared CPU usage will be too much higer in system, which will effect the live system offcourse. Experts i need your earnest advise from you.

# vi /var/opt/remove90dysOldrfiles.sh

#!/usr/bin/sh
find /var/opt/backup/backup1 -name "USR*" -mtime +90 | xargs -n 100 rm -f
find /var/opt/backup/backup2 -name "CUST*" -mtime +90 | xargs -n 100 rm -f
find /var/opt/Mainbackup/backup3 -name "SUB*" -mtime +90 | xargs -n 100 rm -f
find /var/opt/backup/backup4 -name "GP*" -mtime +90 | xargs -n 100 rm -f
find /var/opt/Mainbackup/backup5 -name "AIR*" -mtime +90 | xargs -n 100 rm -f
find /var/opt/backup/backup6 -name "IN*" -mtime +90 | xargs -n 100 rm -f
find /var/opt/Mainbackup/backup7 -name "MS*" -mtime +90 | xargs -n 100 rm -f
  #2 (permalink)  
Old 10-05-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
As you have it, each line will execute sequentially.

The "find" and "xargs" will run in parallel.

If you are concerned about impact on other processes then run using "nice".

man nice

as in

nice /var/opt/remove90dysOldrfiles.sh
  #3 (permalink)  
Old 10-05-2007
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
  
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 2,910
i think it's better to run every line directly from cron on different days (7 lines ) or on different hours of the day. if you run them on times with low activity, everything should be fine....

hth,
DN2
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:14 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0