Skip to content

Deleting a remote file

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
  • jklare Offline
  • Posts: 3
  • Joined: Mon Jan 28, 2013 9:44 am

Deleting a remote file

Post by jklare »

I want to make sure to delete a file from a remote loacation after I am finished with it.
I get this error when I try.


INFO Executing sub-task 'delete'
1/28/13 6:16:01 PM INFO Closed the FTP connection
1/28/13 6:16:01 PM ERROR com.linoma.dpa.util.LocalFile
1/28/13 6:16:01 PM INFO Finished project 'GetServiceNow - working version'
1/28/13 6:16:01 PM ERROR [8099 - sftp] An unexpected error occurred.
com.linoma.dpa.util.LocalFile
com.linoma.dpa.runtime.JobFailedException: [8099 - sftp] An unexpected error occurred.
com.linoma.dpa.util.LocalFile


Any help is appreciated
  • jklare Offline
  • Posts: 3
  • Joined: Mon Jan 28, 2013 9:44 am

Re: Deleting a remote file

Post by jklare »

More info....

Caused by: java.lang.ClassCastException: com.linoma.dpa.util.LocalFile
at com.linoma.dpa.tasks.ftp.DeleteAction.deleteFiles(Unknown Source)
at com.linoma.dpa.tasks.ftp.DeleteAction.execute(Unknown Source)
at com.linoma.dpa.tasks.ftp.AbstractFTPTask.execute(Unknown Source)
at com.linoma.dpa.ModuleV2.execute(Unknown Source)
at com.linoma.dpa.Project.execute(Unknown Source)
at com.linoma.dpa.runtime.Job.executeProject(Unknown Source)
  • User avatar
  • Support_Julie Offline
  • Support Specialist
  • Posts: 91
  • Joined: Thu Mar 05, 2009 3:49 pm
  • Location: Ashland, NE USA
  • Contact:

Re: Deleting a remote file

Post by Support_Julie »

On your FTP GET output variables tab, there is a field to define the "Processed Source Files Variable". Enter something in that field. Then after you GET the files, you need to do an FTP DELETE and reference that variable. Without seeing your project, I am guessing that you are trying to delete the files on you local server rather than the remote server.

Code: Select all

<project name="FTP Get and Delete" mainModule="Main" version="2.0">

	<module name="Main">

		<ftp resourceId="192.168.1.54" version="1.0">
			<get destinationDir="/demo" whenFileExists="overwrite" processedSourceFilesVariable="ProcessedFiles">
				<fileset dir="/temp">
					<wildcardFilter>
						<include pattern="*.txt" />
					</wildcardFilter>
				</fileset>
			</get>
			<delete inputFilesVariable="${ProcessedFiles}" />
		</ftp>

	</module>

</project>
Julie Rosenbaum
Sr Support Analyst
e. [email protected]
p. 1.800.949.4696
w. HelpSystems.com
  • jklare Offline
  • Posts: 3
  • Joined: Mon Jan 28, 2013 9:44 am

Re: Deleting a remote file

Post by jklare »

Thanks Julie. That worked.
  • bmcgoldrick Offline
  • Posts: 2
  • Joined: Thu Feb 21, 2013 3:12 pm

Re: Deleting a remote file

Post by bmcgoldrick »

What if I want to delete the file from the remote FTP host after doing a Get?
  • Support_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: Deleting a remote file

Post by Support_Rick »

BMCGoldRick,

Julie's example has just that identified. It performs an FTP/get then a Delete of the files (ProcessedFiles)

Let us know if you have any other questions.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
  • bmcgoldrick Offline
  • Posts: 2
  • Joined: Thu Feb 21, 2013 3:12 pm

Re: Deleting a remote file

Post by bmcgoldrick »

Rick,
I was confused because she says in her post "I am guessing that you are trying to delete the files on you local server rather than the remote server."
Thanks.
  • Support_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: Deleting a remote file

Post by Support_Rick »

My apologies! I wasn't paying attention to his question, I was just indicating that the Example that she posted does exactly what you were asking. An FTP/Get of files from a server, then deletes those files after they have been retrieved to a local server.

I thought that's what you were looking to do. If so, just copy the code from her example above, change the resource ID's, Folders and/or File Patterns and it should do exactly what you need it to do!

Please let us know...
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Post Reply