Delete processed directories

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
2 posts Page 1 of 1


Posts: 7
Joined: Tue May 20, 2014 6:20 am

Post by Cnile31 » Thu Jul 31, 2014 7:40 am

I have a job that recursively archives files placed in directory X to directory Y within a zip file. After archiving the files to directory Y, the files are removed from directory X.

For some reason, the processed files are deleted from directory X, but the processed directories are not being deleted. Is it possible to also delete the, now empty, directories?

Thanks in advance.

Here is my current code:
Code: Select all
<project name="Job" mainModule="Main" version="2.0">

	<module name="Main" onError="abort">

		<timestamp version="1.0">
			<format outputVariable="Date" pattern="yyyy-MM-dd" />

		<createWorkspace label="createWorkspace" version="1.0" />

		<copy destDir="${system.job.workspace}" whenFileExists="rename" processedSourceFilesVariable="processed" version="1.0">
			<fileset dir="X" recursive="true" />

		<delete inputFilesVariable="${processed}" version="1.0" />

		<zip outputFile="Archive_${Date}.zip" whenFileExists="rename" version="1.0">
			<fileset dir="${system.job.workspace}" recursive="true" />

		<copy destDir="Y" whenFileExists="rename" version="1.0">
			<fileset dir="${system.job.workspace}" recursive="false">
					<include pattern="*.zip" caseSensitive="false" />

		<deleteWorkspace version="1.0" />


	<description>Archive Job</description>


Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Thu Jul 31, 2014 11:05 am
Since you have the directory you are processing (recursively), then just issuing the Delete Task (and identifying the Parent Directory (X) that you're wanting removed will remove it plus any child directories within that Parent location. It will also remove all files from those folders as well.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1