- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Deleting spool files by creation date
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
10-14-2004 04:48 AM
10-14-2004 04:48 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 04:52 AM
10-14-2004 04:52 AM
SolutionThe command would be as follows.
find /path -type -mtime +90 -exec mv {} /dest \;
This would move files more than 90 days old to /dest dir.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 04:52 AM
10-14-2004 04:52 AM
Re: Deleting spool files by creation date
It's rather simple with the find command:
find /dirname -type f -name file_name* -mtime +30 -exec rm {} \;
or
find /dirname -type f -name file_name* -mtime +30 | xargs rm
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 06:22 AM
10-14-2004 06:22 AM
Re: Deleting spool files by creation date
I've been trying your first method. I am logged in as root:
find /ifas/xport/.spool -type f -name O*.data -mtime +90 -exec rm {}\;
I keep getting an error:
find: -exec not terminated with ';'
I do have the ';' at the end of the command line.
When I tried your second method, I got the error:
Usage: rm [-Rfir] file ...
What am I doing wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 06:37 AM
10-14-2004 06:37 AM
Re: Deleting spool files by creation date
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 06:45 AM
10-14-2004 06:45 AM
Re: Deleting spool files by creation date
Anil is exactly right for the first method and I left something out of the second method. I think the second should be
find /ifas/xport/.spool -type f -name O*.data -mtime +90 | xargs rm {}
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 07:31 AM
10-14-2004 07:31 AM
Re: Deleting spool files by creation date
Thank you for your solutions. I got the first method to work. However, for the second method even with the changes, I am still getting an error:
# find /ifas/xport/.spool -type f -name O*.data -mtime +1 | xargs rm{}
xargs: rm{} not found
I've tried it with a space betwwen rm and the {} and without...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 08:11 AM
10-14-2004 08:11 AM
Re: Deleting spool files by creation date
0 5 * * 1 [ -d /var/adm/lp/XEBEC ] && /usr/local/bin/print.clean.receive >/dev/null 2>&1
The -d just makes sure the directory exists (cause I use MC/SG).
# cat /usr/local/bin/print.clean.receive
#!/bin/sh
# Script to remove old print jobs
# Geoff Wild
# April 4 2002
#
find /var/spool/lp/receive -name '*PRD' -mtime +7 -exec rm {} \; >/tmp/lp.receive.log
find /var/spool/lp/receive -name '*QA' -mtime +7 -exec rm {} \; >>/tmp/lp.receive.log
find /var/spool/lp/receive -name '*DEV' -mtime +7 -exec rm {} \; >>/tmp/lp.receive.log
find /var/spool/lp/receive -name '*VPR' -mtime +7 -exec rm {} \; >>/tmp/lp.receive.log
find /var/adm/lp/XEBEC -name '*ftplog' -mtime +7 -exec rm {} \; >>/tmp/lp.receive.log
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 08:47 AM
10-14-2004 08:47 AM
Re: Deleting spool files by creation date
# pwd
/
# find /ifas/xport/.spool -type f -name O*.data -exec rm{} \;
# ll /ifas/xport/.spool
total 54
-rw-rw---- 1 bsi bsi 0 Oct 13 14:05 -t
-rw-rw---- 1 bsi bsi 9272 Oct 13 14:57 O3027.data
-rw-rw---- 1 bsi bsi 5271 Oct 13 16:44 O3058.data
-rw-rw---- 1 bsi bsi 9797 Oct 13 16:50 O3065.data
drwxrwxrwx 2 bsi bsi 96 Jun 12 1999 tailsheets
-rw-rw---- 1 bsi bsi 14 Oct 15 2000 testfile
#
Could someone please take a look at this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 08:52 AM
10-14-2004 08:52 AM
Re: Deleting spool files by creation date
"O*.data"
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 09:00 AM
10-14-2004 09:00 AM
Re: Deleting spool files by creation date
# pwd
/
# whoami
root
# find /ifas/xport/.spool -type f -name "O*.data" -exec rm{} \;
# ll /ifas/xport/.spool
total 54
-rw-rw---- 1 bsi bsi 0 Oct 13 14:05 -t
-rw-rw---- 1 bsi bsi 9272 Oct 13 14:57 O3027.data
-rw-rw---- 1 bsi bsi 5271 Oct 13 16:44 O3058.data
-rw-rw---- 1 bsi bsi 9797 Oct 13 16:50 O3065.data
drwxrwxrwx 2 bsi bsi 96 Jun 12 1999 tailsheets
-rw-rw---- 1 bsi bsi 14 Oct 15 2000 testfile
#
Do you have any other suggestions I could try?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 09:04 AM
10-14-2004 09:04 AM
Re: Deleting spool files by creation date
before the {}
find /ifas/xport/.spool -type f -name "O*.data" -exec rm {} \;
Rgds...geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 09:08 AM
10-14-2004 09:08 AM