One Star

Delete file after archiving on Windows

Hi all,
I have a child job that will archive a file then delete that file immediately after it's been archived. Initially I did this using the Mac version of the studio and everything was working but with the same job but different file directory, it doesn't work when using the Windows version of the studio.
If I were to run the child job separately to just archive and delete the file it would work, but when running the parent job that calls the child job, it will only archive the file but not delete it.
Essentially my child job just looks like the screen shot below. I know for sure that the directory I use is correct because I can run the subjob independent of the parent and everything was working. I also know the parent job is also working because I tested this initially when working on the Mac version of the studio.
Is there a reason why when testing this on the Windows version that my job would stop working? Could the file still be locked and is read only after archiving the file and that's why the job can't delete it? 
12 REPLIES
Moderator

Re: Delete file after archiving on Windows

Hi,
Which build version are you using? What's the error info when you use this job on window server?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Delete file after archiving on Windows

When I run the parent job, I set the sub job component to "Propagate the child result to the output schema" but nothing gets log so I'm assuming that means it's not getting executed or there's just no error log.
It's also set to "die on child error" but it still runs afterwards so I would assume that no error occurs. It's just that the file is still there so I can see that the delete does not happen. The archive file has been created so I can at least see that happening and that the child job is being called.
I'm currently running Talend Open studio for Data Integration but I'm not sure about the version. I just see 5.5.1r118616 at the top of the studio if that helps.
Moderator

Re: Delete file after archiving on Windows

Hi,
How did you set your tfiledelete component? We don't repro your issue on window 7.
Please see my screenshot
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Delete file after archiving on Windows

I made the exact same changes as your screen shot but it still doesn't work.
Moderator

Re: Delete file after archiving on Windows

Hi,
I'm currently running Talend Open studio for Data Integration but I'm not sure about the version. I just see 5.5.1r118616 at the top of the studio if that helps.

Does this issue repro on other build version?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Delete file after archiving on Windows

I don't actually have any other versions of the Studio. I just know the code you gave in your sceenshot doesn't work in the Mac version of the studio as well.
Moderator

Re: Delete file after archiving on Windows

Hi,
What's your current OS? Did you use Windows version of the studio in Window OS?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Delete file after archiving on Windows

Hi,
My current Windows operating system is a Windows 7 64-bit. And yes, I did use the Windows version of Talend Open Studio 64-bit version in Windows.
Moderator

Re: Delete file after archiving on Windows

Hi,
Could you please create a new job with: tFileArchive-->tFileDelete for testing only to see if it is OK with you?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Delete file after archiving on Windows

Sorry, maybe my initial post wasn't clear enough but the job I have running the tFileArchive->tFileDelete is working fine by itself.
If I just run those 2 components by itself, everything is working and the file is being deleted. It's just when I run that job as a child job from another job that the file does not get deleted. 
The idea behind this is a have a re-usable job that archives and deletes the file after a web service is run. The parent job will pass a file directory depending if it succeeds or fail and the archived file will be stored in different folder directories depending on the passed directory string. All the archiving stuff is working fine. The files are being archived into the correct folder but I need that file to be deleted and it is currently not. 
Moderator

Re: Delete file after archiving on Windows

Hi,
Could you please show us your whole job design screenshots so that we can see if there is anything wrong with your Parent job?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Re: Delete file after archiving on Windows

Hi quakev0,
For your First Post: Is there a reason why when testing this on the Windows version that my job would stop working? Could the file still be locked and is read only after archiving the file and that's why the job can't delete it? 
Option 1: If there is any restriction on file like read only it will throw error like "File is read only unable to delete ". Hope for you such Error is not getting?
Option 1: As per my understanding you have imported that Job(Item) which was created in MAC environment to Windows? Instead of doing that can you please create a separate Child jon and parent job in windows and check once because i have tried in windows it is working fine. PFA.  


Regards
Srikanth