Saturday, November 15, 2008

How to restore files interactively using ufsrestore in Solaris

First bring the tape to the beginning ->

mt rew

Now move the tape to proper position if required. The following command will move the tape 10 files forward.

mt fsf 10

set the tape in interactive,verbose mode using->

ufsrestore ivf prddb:/dev/rmt/0n

Now we can use "ls" and "cd" command to view what files and directories are there on the tape.
we can now use the add command to add the files for extraction.
add <directory/filename>
finally we give extract command to extract the files.
extract
Now it prompts to "Specify next volume #"
Here we can type the volume number and press Return. If you have only one volume, type 1 and press Return.

Thursday, November 6, 2008

How to delete old files in solaris

Many times we have a requirement where we want to delete old files. We rather want to delete files based on their creation date-say "n" days old.

For this we have very simple command in solaris->

find /directoryname -mtime +n -exec rm {} \;

example->

find /u9/prddb/9.2.0/admin/PRD_prddb/bdump -mtime +7 -exec rm {} \;

The above command will delete the files which are 7 days old in bdump directory.

Technorati Tags: ,,