Script that doesn't stop


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Script that doesn't stop
# 1  
Old 11-29-2007
Script that doesn't stop

Hi all,
I got a script that runs automatically using the cron file.
The script starts running at midnight and suppose to delete image files from folders and sub-folders. The script ends when he finishes deleting or after 5 hours. My problem is that the script doesn't stop running even after 5 hours, it causes the computer to be slower, so when I type "top" I can see that the "du" process kills the CPU usage.
Is there anyway to force the script to stop?, is it computer configuration related?
Any help will be appreciated.
# 2  
Old 11-29-2007
If it takes you 5 hours to delete files then maybe your need to look at your script again or file management on your server. You must have 100's of thousands of files... Anyways I guess you are doing a check for the 5 hours, a simple exit should do the job. Maybe post your script and people maybe see what you are doing.
# 3  
Old 11-30-2007
Hi
I attached 2 files below:
The script: check_space.txt (just rename to check_space)
The resource file that defines the folders' sizes: check_space.res.txt (just rename to check_space.res)

These are the lines that activates the script from the cron (root):
# PERIODICAL CHECK IMAGE SIZE
6 1 * * * /usr/local/opal/utils/check_space
5 5 * * * killall -9 du
6 5 * * * killall -9 /usr/local/opal/utils/check_space
# 4  
Old 11-30-2007
Does the script run fine on the command line? If not debug the script by putting a set -x at the top (or something similar) of the script and see that
where the script is getting into problems.

HTH
enc.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Set -n doesn't stop executing

When I do "set -n" or "set -o noexec" the shell doesn't do what it sould. Infact if I check: $: set -o .... noexec off .... f ...instead I can set normally the other option. Who Knows what could be up? (2 Replies)
Discussion started by: flaviofachin
2 Replies

2. Shell Programming and Scripting

Stop child script by stoping parent script

Hi everyone, I have this problem with a script I'm writting. I want to execute a code running in the background several times through a script. I am writting it like that parent_script for a in 1 2 3 4 5 do exec test -n $a done What I want to do is when parent_script is killed,... (0 Replies)
Discussion started by: geovas
0 Replies

3. UNIX for Advanced & Expert Users

rc.d script to stop not workign

I have a simple script that I have put in all the rc.d directories from 1-6 and have named it K20blah and S20blah .I am on red hat linux and I see that when i do reboot the S20blah is ignored but the K20blah is executed during startup . Any suggestions? #! /bin/sh # /etc/init.d/blah # #... (3 Replies)
Discussion started by: gubbu
3 Replies

4. Shell Programming and Scripting

How to stop a script running in remote server from local script

Hi, I have googled for quite some time and couldn't able to get what exactly I am looking for.. My query is "how to stop a shell script which is running inside a remote server, using a script"??? can any one give some suggestions to sort this out. (1 Reply)
Discussion started by: mannepalli
1 Replies

5. Shell Programming and Scripting

script don't stop

Hello everybody! I am new to this and I am trying to change a script in an open source program that plots some offset vectors and then calls a postscript viewer. I have commented away the call for the postscript viewer but somehow the script doesn't return to the shell prompt. I cant figure out... (3 Replies)
Discussion started by: larne
3 Replies

6. UNIX for Dummies Questions & Answers

Stop a shell script

Hi, I am writing a bash shell script. How can I tell it to stop. For example, I would like to have something similar to the following: mike=1 if ; then STOP THE SCRIPT fi (3 Replies)
Discussion started by: msb65
3 Replies

7. Shell Programming and Scripting

Script to run non-stop

Hi All, I am on a Solaris OS and i have come up with a csh script named " mycshscript " which will grab data from a datalog file & format the grabbed data & upload formated version to web server. I would want to have this script to run non-stop so that the latest can be captured since data is... (37 Replies)
Discussion started by: Raynon
37 Replies

8. Shell Programming and Scripting

Script does not stop when doing a read

Hi Folks, I have been trying to create a script wherein after it reads a certain number of data, it will pause and ask the user if he wants to continue or not. However, it seems that when it is supposed to read the user's answer, the script will go into a loop. What is wrong with my script here?... (7 Replies)
Discussion started by: rooseter
7 Replies

9. UNIX for Dummies Questions & Answers

Procmail recipe doesn't stop

I have a .procmailrc file that includes a file named .rc.phplist. Within .rc.phplist is the following set of recipes: :0 * $RECIP ?? ^^phplist@$DOMAIN { # Has this message already been sent? If so, delete it. :0h * ^X-Mailing-List: /dev/null :0cw phplist/queue/. :0... (18 Replies)
Discussion started by: elmonty
18 Replies

10. UNIX for Dummies Questions & Answers

Start/Stop Script

I'm a newbie to the Unix world Help! I have to maintain a host of Sybase database servers sitting on Unix Sun Solaris 8...I've been tasked with finding/creating a way to auto start/stop Unix via unix commands, specifically when the Unix servers need to be restarted we want Sybase to start... (2 Replies)
Discussion started by: jjv1
2 Replies
Login or Register to Ask a Question