Sequencer

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

narasimha wrote:You could do it as a part of the same activity, just append

Code: Select all

&& rm -r /home/edw
to your command (Assuming you want to remove edw directory)
Thanks Narasimha.
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

narasimha wrote:You could do it as a part of the same activity, just append

Code: Select all

&& rm -r /home/edw
to your command (Assuming you want to remove edw directory)

I need to parameterize my path and I am not able to do it in the command field. I tried to use 'sh' earlier and then parameterize my path in the parameters field but it didnt work. So how would I parameterize the path.

Thanks
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Break up your paramenters into directory and file - something like

DEL_DIR --> /home/edw/
DEL_FILE --> delstatus.txt

Command:

Code: Select all

test -f
Parameters:

Code: Select all

#DEL_DIR##DEL_FILE# && rm -f #DEL_DIR##DEL_FILE# && rm -r #DEL_DIR#
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

narasimha wrote:Break up your paramenters into directory and file - something like

DEL_DIR --> /home/edw/
DEL_FILE --> delstatus.txt

Command:

Code: Select all

test -f
Parameters:

Code: Select all

#DEL_DIR##DEL_FILE# && rm -f #DEL_DIR##DEL_FILE# && rm -r #DEL_DIR#
Narasimha Thanks for the help but I got this message in director.

Reply=1
Output from command ====>

It is not deleting the file or directory :?
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Not sure where you are going wrong. :?:
Can you post the complete message from the director
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

narasimha wrote:Not sure where you are going wrong. :?:
Can you post the complete message from the director


Message:
delete_seq..JobControl (@ec_DeleteStatusFile): Executed: test -f /home/edw/deletestatus/home/edw/delstatus.txt && rm -f /home/edw/deletestatus/home/edw/delstatus.txt && rm -r /home/edw/deletestatus
Reply=1
Output from command ====>

The sequencer ran ok but it didnt delete the status file or directory.
Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The test failed, so no further steps were run. Is this really the full path to your status file?

/home/edw/deletestatus/home/edw/delstatus.txt

I don't think so.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

chulett wrote:The test failed, so no further steps were run. Is this really the full path to your status file?

/home/edw/deletestatus/home/edw/delstatus.txt

I don't think so.

status file path is /home/edw/delstatus.txt
directory path is /home/edw/deletestatus

I need to delete both of them. How would I accomplish this ?

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Harken back to the advice given to you by Narasimha. Use two parameters. Seeing as your file is apparently *not* in the directory to be deleted, one will hold the directory and one for the file itself.

Easy Peasy.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

dspxguy wrote:
narasimha wrote:Break up your paramenters into directory and file - something like

DEL_DIR --> /home/edw/
DEL_FILE --> delstatus.txt

Command:

Code: Select all

test -f
Parameters:

Code: Select all

#DEL_DIR##DEL_FILE# && rm -f #DEL_DIR##DEL_FILE# && rm -r #DEL_DIR#
Chulett, I am using two parameters and following what Narasimha adviced. but still cant make it work

Reply=1
Output from command ====>

It is not deleting the file or directory :?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Come on... I didn't say for you to slavish do exactly what he said but to follow his advice. Beside, that was before you showed that your file was not in the same directory being deleted, which was the assumption under which the previous advice was given. Use some common sense.

Some questions:

Is #DEL_DIR##DEL_FILE# the full path to your file? Yes.

Is #DEL_DIR# the full path to your directory? No.

How do you think this thorny problem can be solved? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

chulett wrote:Come on... I didn't say for you to slavish do exactly what he said but to follow his advice. Beside, that was before you showed that your file was not in the same directory being deleted, which was the assumption under which the previous advice was given. Use some common sense.

Some questions:

Is #DEL_DIR##DEL_FILE# the full path to your file? Yes.

Is #DEL_DIR# the full path to your directory? No.

How do you think this thorny problem can be solved? :?
Chulett sorry, wasnt really concentrating...got it solved
thanks
Post Reply