LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices

Reply
 
LinkBack Search this Thread
Old 03-16-2012, 11:44 AM   #16
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371

Hi,

Which OS are you using? Linux (if so: which distro), hp-ux, solaris, sunos, aix, ..?
 
Old 03-16-2012, 11:49 AM   #17
lithos
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

Rep: Reputation: 217Reputation: 217Reputation: 217
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 .....
 
Old 03-16-2012, 11:51 AM   #18
evilputty
LQ Newbie
 
Registered: Mar 2012
Posts: 18

Rep: Reputation: Disabled
you'll need to parse filenames to go by date which is noted within the filename thats why the previous command will not work.
 
Old 03-16-2012, 11:54 AM   #19
arjundey
LQ Newbie
 
Registered: Sep 2011
Posts: 24

Original Poster
Rep: Reputation: Disabled
@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 ?
 
Old 03-16-2012, 12:10 PM   #20
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,
Quote:
Originally Posted by arjundey View Post
@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).
 
Old 03-16-2012, 01:14 PM   #21
evilputty
LQ Newbie
 
Registered: Mar 2012
Posts: 18

Rep: Reputation: Disabled
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
 
Old 03-16-2012, 03:13 PM   #22
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,361

Rep: Reputation: 1910Reputation: 1910Reputation: 1910Reputation: 1910Reputation: 1910Reputation: 1910Reputation: 1910Reputation: 1910Reputation: 1910Reputation: 1910Reputation: 1910
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.
 
Old 03-19-2012, 01:36 AM   #23
arjundey
LQ Newbie
 
Registered: Sep 2011
Posts: 24

Original Poster
Rep: Reputation: Disabled
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?
 
Old 03-19-2012, 05:28 AM   #24
arjundey
LQ Newbie
 
Registered: Sep 2011
Posts: 24

Original Poster
Rep: Reputation: Disabled
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.
 
Old 03-24-2012, 04:08 PM   #25
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,459

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
As requested, moved to the AIX forum
 
  


Reply

Tags
cron, crontab, ftp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] /etc/cron.daily/slocate.cron - multiple /usr/bin/updatedb degrades performance ray63 Linux - Server 2 01-05-2012 05:04 PM
Why is the text file format changing while transferring thru FTP ? apanimesh061 Programming 4 09-22-2011 02:56 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM
Daily Cron jobs with a PHP file Gargomel7 Programming 7 09-13-2003 07:21 PM


All times are GMT -5. The time now is 10:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration