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.
8 posts Page 1 of 1

jklare

Posts: 3
Joined: Mon Jan 28, 2013 9:44 am

Post by jklare » Tue Jan 29, 2013 10:26 am
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

Posts: 3
Joined: Mon Jan 28, 2013 9:44 am

Post by jklare » Tue Jan 29, 2013 10:42 am
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)

Support_Julie

User avatar
Support Specialist
Posts: 90
Joined: Thu Mar 05, 2009 3:49 pm
Location: Ashland, NE USA

Post by Support_Julie » Tue Jan 29, 2013 10:42 am
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. goanywhere.support@helpsystems.com
p. 1.800.949.4696
w. HelpSystems.com

jklare

Posts: 3
Joined: Mon Jan 28, 2013 9:44 am

Post by jklare » Tue Jan 29, 2013 11:13 am
Thanks Julie. That worked.

bmcgoldrick

Posts: 2
Joined: Thu Feb 21, 2013 3:12 pm

Post by bmcgoldrick » Fri Feb 22, 2013 1:38 pm
What if I want to delete the file from the remote FTP host after doing a Get?

Support_Rick

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

Post by Support_Rick » Fri Feb 22, 2013 2:37 pm
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

Posts: 2
Joined: Thu Feb 21, 2013 3:12 pm

Post by bmcgoldrick » Fri Feb 22, 2013 4:15 pm
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

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

Post by Support_Rick » Fri Feb 22, 2013 5:33 pm
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
8 posts Page 1 of 1