- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cron Job to Delete files in /tmp directory
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
Discussions
Discussions
Discussions
Forums
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
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
тАО04-26-2004 08:03 AM
тАО04-26-2004 08:03 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2004 08:11 AM
тАО04-26-2004 08:11 AM
Solution00 06 * * * /sbin/find /bkup_mnt/oradev/arch -type f -ctime +1 -name *.ARC -exec rm -f {} \;
all one line
ctime +1 will delete stuff that is on day old or older
*.ARC is the file extension I suppose you could use *
ran weekly you would want say sunday @6
0 6 * * 0
man crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2004 08:11 AM
тАО04-26-2004 08:11 AM
Re: Cron Job to Delete files in /tmp directory
#!/bin/sh
rm /tmp/*.log #remove all files with .log
rm /tmp/report* #remove all report files
Then save the script as cleanup.sh for example. The do the following:
# crontab -e
This will allow you to add cron jobs. Here is the format of each line in the file:
min hr day month day of week command
Therefore, if you want it to run on the 15th of every month, add a line like this for example:
00 00 15 * * /scripts/cleanup.sh
-Hazem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2004 08:18 AM
тАО04-26-2004 08:18 AM
Re: Cron Job to Delete files in /tmp directory
There is an interactive functionality available if you have an add in library. This one cleans pdf files. Its easily modifyable to clean /tmp, just set up the directories you want it to scour in a config file.
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
тАО04-26-2004 09:21 AM
тАО04-26-2004 09:21 AM
Re: Cron Job to Delete files in /tmp directory
find /tmp -mtime +25 -exec rm -rf *foo \;
note: any mistake with "*" can be dangerous.