Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AIX Find files

Status
Not open for further replies.

subsar

Technical User
Aug 12, 2014
1
GB
Hi,

I have files like test-2014-08-08.tar.gz live-2014-08-09.tar.gz for each date I just want to sort only files for today and save that files alone to tape in IAX.

Please could one of you help me in with this?

Thanks,
 
Not really sure what you are asking for...

If you do not have the man pages installed you can read them online:

For the find command:

You did not specify your AIX release, the links are for AIX 6.1

If you know the date you are looking for and the way it is represented in the filename you can search for it with the find command, or you could list the directory contents and then grep for the date...

ls command:

grep command:

Or are you asking for someone to (do your job for you) write a script to backup the files you want to your tape drive for you? If so then we are going to need a lot more information.....
 
You could start with something like this:

Code:
#!/usr/bin/ksh

today=$(date +%Y"-"%m"-"%d)
ls /your-path/ | grep $today | while read list; do your-backup-command $list"; done


Regards,
Thomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top