05-26-2011
Files in subdirectories may be newer than the parent dir, so this sounds insufficient and dangerous. Most go by mtime not ctime.
But, if your situation is that the files and subdirs are laid down just after the directory is created, that is OK. Using -depth seems like a waste, and + from {} is faster. Note that if rm returns not zero, because it cannot remove something due to permissions, find stops.
Does your script have a good #!path-to-shell as line 1, and chmod executable? It may be running under a different shell in the scheduler.
Last edited by DGPickett; 05-26-2011 at 11:06 AM..
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hey, I have to write a housekeeping script which would delete any files which are more than 10 days old, the file is named in such a fashion
MYTEST20060101_182239.txt
MYXML20060112_182879.xml
MYEXCEL20060113_546321.xls
If the current date is 20060112, then MYTEST20060101_182239.txt will be... (2 Replies)
Discussion started by: mpang_
2 Replies
2. Shell Programming and Scripting
Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered.
The script is as follow:
#!/bin/sh
for file in file_1.txt file_2.txt file_3.txt
do
awk '{ print "0" }' $file > tmp.tmp
mv tmp.tmp $file
done
And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies
3. Shell Programming and Scripting
I have a directory ( eg. /tmp , there are many files in it , I would like to do the houskeeping job , can advise how to develop a script to do the following .
1) if the files are elder than 10 days in this directory , the extension is .txt , then move it to /tmp/tmp-txt , the same , if the files... (2 Replies)
Discussion started by: ust3
2 Replies
4. Shell Programming and Scripting
I am trying to automate a script where I need to use pbrun /bin/su but for some reason it is not passing thru the pbrun as my code below.
. ~/.bash_profile
pbrun /bin/su - content
c h 1
hpsvn up file path
I am executing this from an external .sh file that is pointing to this scripts file... (14 Replies)
Discussion started by: jorgejac
14 Replies
5. HP-UX
I have noticed that after I clear up the /var filesystem, there are always problems.
Does deleting the OLDsyslog.log file cause problems like missing directories and problems accessing crontabs?
There were two situations where I faced problems.
1) Deleted OLDsyslog.log (Of course I created... (5 Replies)
Discussion started by: anaigini45
5 Replies
6. Shell Programming and Scripting
Hello, Newbie here,
I have a perfectly well working web service call I can issue from chrome (PC Windows 10) and get the results I want (a dimmer being turned on in Fibaro Home Center 2 at level 40)
I am not allowed to post urls but the below works with http and :// and... (3 Replies)
Discussion started by: abigbear
3 Replies
7. AIX
Hello,
Does anyone know how to housekeeping the null 2>&1 file in /dev?
its fill up my system, please help.
Thanks :b: (3 Replies)
Discussion started by: only
3 Replies
8. Shell Programming and Scripting
Hi Team,
I have written the shell script which returns the result of the disk space filesystems which has crossed the threshold limit in HTML Format. Below mentioned is the script which worked perfectly on QA system.
df -h | awk -v host=`hostname` '
BEGIN {
print "<table border="4"... (13 Replies)
Discussion started by: Harihsun
13 Replies
9. UNIX for Beginners Questions & Answers
We have regularly questions about how to create users and user accounts. But regularly user accounts need to be deleted too. It is quite easy to delete the user account itself but usually the HOME directory of the user remains.
It is good style to remove these directories but simply deleting... (3 Replies)
Discussion started by: bakunin
3 Replies
fixman(1M) fixman(1M)
NAME
fixman - fix manpages for faster viewing with man command
SYNOPSIS
alt-path]
DESCRIPTION
The command is a shell script that processes manpages in the directories to unexpand spaces to tabs where possible, and to remove all char-
acter-backspace pairs (which usually exist to cause overstriking or underscoring for printer output). Removal of unnecessary character
sequences improves the speed of man(1), and reduces disk space consumption. The command should be run after using to create formatted,
manpages from unformatted, source files (see catman(1M)).
By default, searches for subdirectories in the following parent directories in the order indicated:
o
o
o
If the environment variable is set, the directory paths specified by are searched instead of the default. See environ(5) for a description
of the environment variable.
The command does not remove duplicate blank lines. Thus, all files remain a multiple of one page (66 lines) long and can still be passed
directly to (see lp(1)). (Note that man(1) normally uses to accomplish this removal.)
To ensure success, should be run by a user who has appropriate privileges. It will take awhile to complete depending on system speed,
load, memory size, etc. As a side-effect, file ownerships and permissions may be changed.
Options
Perform actions based on the given alternate root.
With this option, alt-path will be prepended to all directory paths, including default paths or the paths defined by
EXTERNAL INFLUENCES
Environment Variables
if set, defines the directories to be searched for manpages.
WARNINGS
If the value of is not the same while is running as it was when was run or when manpage files were installed, some files may be missed and
not processed (see catman(1M)).
EXAMPLES
Run fixman from a server to fix the manpages on a diskless under the alternate root
This will fix manpages in directories under:
FILES
Directories containing [compressed]
nroff(1)-formatted versions of manpages
AUTHOR
was developed by HP.
SEE ALSO
catman(1M), chmod(1), expand(1), lp(1), man(1), mv(1), sed(1), environ(5).
fixman(1M)