AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
03-16-2012, 11:44 AM
|
#16
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,704
|
Hi,
Which OS are you using? Linux (if so: which distro), hp-ux, solaris, sunos, aix, ..?
|
|
|
|
03-16-2012, 11:49 AM
|
#17
|
|
Senior Member
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144
|
Have you tried your last line
Code:
find /home/evaxd4/FTP_CRON/ -name "pso_whse_orders_inout.*" -mtime +3 -exec rm -f {} \;
running manually from command line ?
What does it do ?
It may be you don't have $PATH to the Find command, so try use
Code:
/usr/bin/find .....
|
|
|
|
03-16-2012, 11:51 AM
|
#18
|
|
LQ Newbie
Registered: Mar 2012
Posts: 18
Rep: 
|
you'll need to parse filenames to go by date which is noted within the filename thats why the previous command will not work.
|
|
|
|
03-16-2012, 11:54 AM
|
#19
|
|
LQ Newbie
Registered: Sep 2011
Posts: 24
Original Poster
Rep: 
|
@druuna - It's a Solaris OS.
@lithos - When I type this command and hit enter, no error is thrown. It just feels like the command has been executed successfully but without effecting the idea behind it - the files to be purged still stays.
@evilputty - I'm new to Unix. Can you please elaborate on how this parsing could be done ?
|
|
|
|
03-16-2012, 12:10 PM
|
#20
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,704
|
Hi,
Quote:
Originally Posted by arjundey
@druuna - It's a Solaris OS.
|
That is important information. Solaris is linux alike, but definitely not the same.
I've asked a moderator to move this to the Solaris sub-forum, which will improve the chances for getting the correct answer(s).
|
|
|
|
03-16-2012, 01:14 PM
|
#21
|
|
LQ Newbie
Registered: Mar 2012
Posts: 18
Rep: 
|
A little googlefu came up with this link.
http://www.linuxquestions.org/questi...please-276744/
Once the cron catches up you should be able to start using
Code:
find /home/evaxd4/FTP_CRON/ -name "pso_whse_orders_inout.*" -mtime +3 -exec rm -f {} \;
since its based off modified time not the time located within the filename.
you could use this script to set the modified time to the existing files to the date appended to the filename.
Code:
#!/bin/sh
for filename in /location/to/pso_whse_orders_inout.*
do
MODDATE=`echo $filename | sed -n 's/^.*\.\([0-9]*\)$/\1/p'`
touch $filename -t $MODDATE"1200"
done;
not sure for solaris but it works fine with linux
Last edited by evilputty; 03-16-2012 at 02:41 PM.
Reason: add script to change modified time
|
|
|
|
03-16-2012, 03:13 PM
|
#22
|
|
Moderator
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.4 OpenSuSE 12.2
Posts: 9,897
|
Moved: This thread is more suitable in Solaris/Opensolaris and has been moved accordingly to help your thread/question get the exposure it deserves. Thanks druuna for reporting.
|
|
|
|
03-19-2012, 01:36 AM
|
#23
|
|
LQ Newbie
Registered: Sep 2011
Posts: 24
Original Poster
Rep: 
|
I am sorry friends. I am actually using AIX Version 6.1 , not Solaris. Apologies !!!!
@colucix - Please move it again to the relevant forum.
@All - I am still not able to figure out the purging of files greater than 3 days old. Any ideas please?
|
|
|
|
03-19-2012, 05:28 AM
|
#24
|
|
LQ Newbie
Registered: Sep 2011
Posts: 24
Original Poster
Rep: 
|
Ok guys. I just figured out that the same command is working now as the problem was with the time of the file when it was created and not just in the date mentioned in the filename. The command
I am marking this thread as resolved now.
Sorry for the confusion on OS & thanks to everyone who contributed your valuable suggestions.
|
|
|
|
03-24-2012, 04:08 PM
|
#25
|
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OL
Posts: 9,311
|
As requested, moved to the AIX forum
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:10 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|