1832928 Members
2463 Online
110048 Solutions
New Discussion

Re: A script require:

 
Deepu Chakravarty
Regular Advisor

A script require:

I require a script which does the following:
1.Accept a date
2.From the directory where the script is being run, Move all files which mathes with the accepted date to different directory location.
3.Archive those moved files to a tar format file
4.gzip the tar file.

Validation checks in the script:
1.Accepted date should be present in the directory in the form of a file.
2.Accepted date should not be a current system date and the date should be a date 3 days older than the current system date.

If either/both the validation checks fails the script should be run again with a proper message.


4 REPLIES 4
Paula J Frazer-Campbell
Honored Contributor

Re: A script require:

Hi

Start with man find -- look at "mtime" and "-exec" to action on the files the tar/gzip.

Also search the forum for "date hammer" it may be useful to you.

Many forum member could write this script for you but I feel that at least an attempt should be made by you.


Paula
If you can spell SysAdmin then you is one - anon
Paula J Frazer-Campbell
Honored Contributor

Re: A script require:

Hi

Please assign points to those members who have assisted you in the past.

http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA1027628&listType=question&forumId=1

Paula
If you can spell SysAdmin then you is one - anon
Sanjay Kumar Suri
Honored Contributor

Re: A script require:

Thanks Paula. I made the same request in the post:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=547749

sks

A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Paula J Frazer-Campbell
Honored Contributor

Re: A script require:

Hi Sanjay

Thanks for that. Are you working or just surfing?


Paula
If you can spell SysAdmin then you is one - anon