AIX script

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

AIX script

Roshan
Hi,

I want to copy files older than 1 day from 1 folder to another. I have a script

find /home/test/*.gz -mtime -1 -exec cp {} targetdir \;

it does not work on aix

Please advise.

Regards,
Roshan
Reply | Threaded
Open this post in threaded view
|

Re: AIX script

ErmanArslansOracleBlog
Administrator
I have no AIX currently, so test the below command yourself; (in a test system first)

find /search_dir -name "*.txt" | xargs -t -I {} cp -p {} {} /dest_dir/


Reply | Threaded
Open this post in threaded view
|

Re: AIX script

Roshan
The script is working. But where should I specify the time?
Reply | Threaded
Open this post in threaded view
|

Re: AIX script

Roshan
I have tested it with

find /archicom/data/arch/chrg/MMS/*gz -mtime +0 -mtime -2  -exec cp {} /u01/migrationprod \;

it works

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: AIX script

ErmanArslansOracleBlog
Administrator
Good Roshan..