- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script problem.
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
Forums
Discussions
Discussions
Discussions
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
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
03-28-2007 05:20 AM
03-28-2007 05:20 AM
script problem.
Here is the part of the script that runs in the cron file:
touch /tmpspool/.stdlist /tmpspool/err /tmpspool/download /tmpspool/fxpress /tmp
spool/payrpts /tmpspool/payxtracts /tmpspool/workcomp
ll -d /tmpspool/.stdlist /tmpspool/err /tmpspool/download /tmpspool/fxpress /tmp
spool/payrpts /tmpspool/payxtracts /tmpspool/workcomp
rm -rf `find /tmpspool -mtime +2`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2007 05:29 AM
03-28-2007 05:29 AM
Re: script problem.
Just out of curiosity, I would try:
find /tmpspool -type f -mtime +2 |xargs rm
rather than your "rm -rf `find /tmpspool -mtime +2`". You may or may not want to omit the "-type f", depending on whether you wish to remove directories as well as files.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2007 05:31 AM
03-28-2007 05:31 AM
Re: script problem.
The behavior of touch has not changed. Touch will merely update the timestamp of an an existing file (and do nothing else). Note that in UNIX speak, a file might be a regular file, a directory, a device node, among others but touch will never transform a directory file into a regular file. What is actually happening is that some of these files do not exist and touch dutifully creates them as regular files. You need to add a test to see if the files (again, think directory files) in your list exist and, if not, do a mkdir before touch is ever executed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2007 05:31 AM
03-28-2007 05:31 AM
Re: script problem.
HP-UX 11.23 is much more advanced than 11.00.
But what you are describing is core functionality that should not have changed.
You say you've posted part of the script that runs in the cron file. Is it possible that some other part of the script is erroring out?
Try putting a set -x in the top of the script and running it manually. You may find the problem this way.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2007 05:47 AM
03-28-2007 05:47 AM
Re: script problem.
Nothing has changed really. You aren't being very rigourous in your selections.
First, use '-type f' with your find if you truly only want *files* removed and not their parental directories.
Regardless of that, use '-depth' which causes 'find' to examine the _contents_ of directories it visits _before_ examining the directory! The act of deleting a file in a directory will update the directory's 'mtime' and thus the directory will not be a candidate for selection.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2007 07:30 AM
03-28-2007 07:30 AM
Re: script problem.
You can always use mkdir -p and you don't need to test before the touch.