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
01-18-2008 08:45 AM
01-18-2008 08:45 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2008 08:51 AM
01-18-2008 08:51 AM
SolutionIs there a standard naming convention for the file name? you can simply add a cron entry to copy that file to another location before the deletion time so you will have a copy of that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2008 08:59 AM
01-18-2008 08:59 AM
Re: Script
find /start-dir -type f -name your_file_name -mtime +7 -exec rm {} \;
- or -
find /start-dir -type f -name your_file_name -mtime +7 |xargs rm
The second version is probably a bit more efficient.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2008 09:09 AM
01-18-2008 09:09 AM
Re: Script
while [[ i!=0 ]]
do
if [ -f myfile.$i ]
then
mv myfile.$i myfile.$((i+1))
fi
mv newfile myfile.0
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2008 09:34 AM
01-18-2008 09:34 AM
Re: Script
find . -type f ! -mtime -7 -exec rm {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 12:01 AM
01-21-2008 12:01 AM
Re: Script
1) in your crontab script you already have add this at the beginning:
cp your_file your_file _$(date +%u)
this will copy your file adding at the end the number of the day of the week 9see man date for further info)
2) create a new script scheduled the last day of the week:
rm your_file_
last day of the week depedn on your environment usually is 6.
Just my .02$
Rgds,
Art