Cleanup job to remove old files suddenly not working


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Cleanup job to remove old files suddenly not working
# 1  
Old 09-29-2009
Question Cleanup job to remove old files suddenly not working

Hi I have a job that has been running for a while with the following statement to cleanup a directory:
find /dbmgtu01/app/myplace/log ! \( -name "dc*" -o -name "sc*" -o -name "ms*" \) -type f -mtime +30 -print -exec rm {} \ ;

The directory was recently changed to a mount point, with a symbolic link to the new location. All other commands used in conjunction with the directory seem to work the same.

The command above, does not return any results, it quickly returns to the prompt.

If I cd to the directory and execute the following command, it works.
find . ! \( -name "dc*" -o -name "sc*" -o -name "ms*" \) -type f -mtime +30 -print -exec rm {} \

Any advise on how I can get the existing command to work is appreciated.
# 2  
Old 09-29-2009
Hi.

Try using the -follow option of find to "follow" symbolic links.
# 3  
Old 10-06-2009
Thanks for your response, I ended up using the -L (follow link) parameter and that did the trick. I love this site, it is always helpful.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Backup files cleanup

Hello, I've been able to keep a certain number of backup files with the find -mtime command, but is there a way to add the last 4 Sunday's or any other day? I checked the man page and forums, but couldn't find anything. Any help would be appreciated. Thanks (8 Replies)
Discussion started by: Ramsez
8 Replies

2. UNIX for Dummies Questions & Answers

Crontab job is not working

hell all: i am trying to test a crontab job for snmpwalk but it is not working: here is crontab: */1 * * * * root /root/snmpwalk.sh for the script, it is very simple: #!/usr/local/bin/bash /usr/local/bin/snmpwalk -v 2c -c public 100.10.10.10 (6 Replies)
Discussion started by: ipfreak
6 Replies

3. UNIX for Dummies Questions & Answers

FTP batch file suddenly stopped working

Hello, we have a UNIX system the runs our business data. We have 4 users that use a particular batch command file to extract data for use in the Windows side of the fence: (despreg.bat) ftp ftp> open danapak (database name) connected to danapak ftp> user ccsb password ccsb ftp>... (29 Replies)
Discussion started by: Mick_Dundee
29 Replies

4. Solaris

Cleanup special files create via device match in a whole root zone

I added in the configuration file of a whole root zone the following device match entries: <device match="/dev/rmt/*"/> <device match="/dev/sg/*"/> after the reboot the zone was able to see all the devices of its global zone, and let under /dev/rmt and /dev/sg the special files created with... (1 Reply)
Discussion started by: hugo_perez
1 Replies

5. UNIX for Dummies Questions & Answers

Cron job not working

cron process in AIX is there when I do ps -ef |grep cron, but none of cron job is working. It appears that cron process is hanging or having some issues? How do you resolve this? Do I kill the cron process by kill -9 PID? and how to start it? Please advise. (1 Reply)
Discussion started by: Daniel Gate
1 Replies

6. Shell Programming and Scripting

cron job now working?

Hi all, I wrote a script as below, #!/bin/ksh . /app/home/etc/sudo.profile >/dev/null java -jar $HOME/abc.jar The jar file abc.jar is located in the same folder as the script. When I'm manually running that script the jar file gets executed. However if I set a cron job, it... (5 Replies)
Discussion started by: isaacniu
5 Replies

7. Shell Programming and Scripting

Code to remove files when corresponding file doesnt exist isnt working.

I am trying to add some code to the begging of a script so that it will remove all the .transcript files, when their is no coressponding .wav file. But it doesnt work. This is the code I have added: for transcriptfile in `$voicemaildir/*.transcript`; do wavfile=`echo $transcriptfile | cut -d'.'... (2 Replies)
Discussion started by: ghurty
2 Replies

8. Shell Programming and Scripting

performing cleanup when a job finishes

The title sounds like an easy problem (maybe it is), however, the catch is that when a job 'A' is called inside a wrapper, the execution does not wait for 'A' to finish, but it goes on to the next line (right after kicking off 'A'). My question is, how will you keep the execution waiting for... (4 Replies)
Discussion started by: ChicagoBlues
4 Replies

9. UNIX for Dummies Questions & Answers

Cron job not working

Hello, I have the following crontab entry that does not seem to be running. When I check /var/cron/log, it is not there. Here is my os info: SunOS birch 5.9 Generic_118558-09 sun4u sparc SUNW,Sun-Fire-V240 Here is the crontab entry: 01 21 * * * find /export/app/datafeed/flus/archive -mtime... (5 Replies)
Discussion started by: dkranes
5 Replies

10. Shell Programming and Scripting

Cron job not working

Hi All, I created a shell script and it works perfectly fine when I run from the command. But the same does not work as expected when I call it from a cron job. Here is the shell script(scan.sh): # # #Which directory to scan for files?... (7 Replies)
Discussion started by: janavenki
7 Replies
Login or Register to Ask a Question