Hi,
I'm trying to make a simple download and delete script, the examples shown online are slightly different.
I'd like to log into the ftp site
navigate through some folders
copy all files with a mask blabla*.bak etc.
paste in a local folder
delete files from ftp
no need for error checking. This should be pretty simple but I'm struggling to get it working properly.
Really appreciate any help
NIck
I'm trying to make a simple download and delete script, the examples shown online are slightly different.
I'd like to log into the ftp site
navigate through some folders
copy all files with a mask blabla*.bak etc.
paste in a local folder
delete files from ftp
no need for error checking. This should be pretty simple but I'm struggling to get it working properly.
Really appreciate any help
NIck
Hello Nick,
I've written this small example. It is based on the script download_and_delete.ftp you can find on the Script library section but it is modified according to what you said. I hope it helps:
I've written this small example. It is based on the script download_and_delete.ftp you can find on the Script library section but it is modified according to what you said. I hope it helps:
FTP Script
- # go to folder 1
- # Append the lists. Lists are just text string with
- # file names separated by "|"
- $list=$list1."|".$list2
- # For each file in $list...
- # Download the file
- # If the file has been succesfully downloaded
- # delete the remote copy. If not stop the script.
- # go to folder 2
- # Append the lists. Lists are just text string with
- # file names separated by "|"
- $list=$list1."|".$list2
- # For each file in $list...
- # Download the file
- # If the file has been succesfully downloaded
- # delete the remote copy. If not stop the script.
- # Close the connection
liked Script FTP? Try our other product Email Parser
Thanks that's really helpful. It works well.
if I just have 1 file type to copy and delete I guess I can remove the 2 lines....
[ScriptFTP]GETLIST($list2,REMOTE_FILES,"blabla2*.txt")
$list=$list1."|".$list2[/ScriptFTP]
??
thanks again
if I just have 1 file type to copy and delete I guess I can remove the 2 lines....
[ScriptFTP]GETLIST($list2,REMOTE_FILES,"blabla2*.txt")
$list=$list1."|".$list2[/ScriptFTP]
??
thanks again
Yes, correct. You can remove that lines. It should look like this:
liked Script FTP? Try our other product Email Parser