how to delete these scratch files after sort

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ashcar
Charter Member
Charter Member
Posts: 28
Joined: Mon Feb 09, 2004 11:54 am
Location: Minneapolis

how to delete these scratch files after sort

Post by ashcar »

I have long list of directories in my project folder which i suspect are scratch files after sort,
/proj/dsadm/Ascential/DataStage/Projects/Dvl

so-O3nUa
so-_mnia
so3vQjEa
so4JQa7a
so4xedya
so5hYbaa
so9-Qoya
soPDijMa..................................


these directories cannot be deleted even by the owner of directory or by dsadm, nor can you peek inside those directories.
What are those directories?
Is it a residue after sort files are done ?
why does datastage not clear them once sort is completed ?
is there anyway that scratch files like these can be deleted ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

WHY can't they be deleted? What's the permission on them? What's the permission on the parent directory? Are they still in use (use fuser to find out)? What error message is generated if you try to delete one of them?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The best way to delete these sort temp files from the Project is to not create them there in the first place! :wink:

There is a property in the Sort stage that tells it where to put them when it runs. By default it is blank which means the Project. Never leave it blank. I always set that property to "/tmp" and then the SA's have processes in place to clean things out from there after a certain number of days.

ps. If you don't have the permissions you need to delete them, ask a 'super-user' to do it for you. Or seek The Sword of a Thousand Truths.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

There are chances for the files to be created and not cleared by the jobs when the jobs aborted for that run.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And sometimes they're just not cleared, period. Best to create them off someplace else where you don't have to worry about them.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... unless /tmp is very small, which it often is on Solaris especially (and they mount swap there also!)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ashcar
Charter Member
Charter Member
Posts: 28
Joined: Mon Feb 09, 2004 11:54 am
Location: Minneapolis

Post by ashcar »

ray.wurlod wrote:... unless /tmp is very small, which it often is on Solaris especially (and they mount swap there also!)

Our filesystem space for /tmp in AIX 5.3 is very small so instead will take the Crontab approach to find and delete allover the DataStage projects.

every user who ran sort jobs had directories with their name and permissions to owner only

/proj/dsadm/Ascential/DataStage/Projects/Dvl
drwx--S--- 2 tice dstage 256 Jun 07 13:38 sod5em7a
drwx--S--- 2 xxxxxxx dstage 4096 Mar 29 2006 soegImia
drwx--S--- 2 xxxxx dstage 256 Jun 07 14:59 sofxYeMa
drwx--S--- 2 xxxxx dstage 4096 Oct 12 2005 sog_mpya

these are old directories and so asked the SA to change persmissions so dsadm can open/delete them
find them using
$ find . -name [io]pf__* -ctime +30 -exec dirname {} \; | sort -u

Proposed Crontab entry: find . -name [io]pf__* -ctime +30 -exec rm {} \;
**** --- this removes the files but leaves the directory. . . May have to do a rm -r $(dirname {})

the dirname is used with [io]pf__* in commands above to make sure only sort temp file directories are deleted .

All these started because we ran out of disk space but never knew who was hogging space

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You might need hard quotes around the wildcarded -name option for the find command

Code: Select all

find . -name '[io]pf__*' -ctime +30 -exec rm {} \; 
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply