Scripting (37 Views)
Reply
CBZ
Occasional Advisor
CBZ
Posts: 10
Registered: ‎10-27-2009
Message 1 of 2 (37 Views)

Scripting

Hi All,

I would like to write a script which will do following task.

1.Search for all file(assume txt files) which is 20 days older.
2.Once we have the file with their location it will compress it in their respective location.

Please help me to prepare this script.

Thanks,
CBZ
Please use plain text.
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 2 of 2 (37 Views)

Re: Scripting

Hi:

# find /path -xdev -type f -mtime +20 -exec gzip {} \;

Substitute whatever you need for '/path'.

Regards!

...JRF...
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation