ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Post here if you experience file transfer problems or unexpected errors.
Hi,

We've changed servers and I have moved across the scripts.
I am receiving the following error when I start to run Script Ftp on the new server:
Script error on line 7, column 1: EOF expected
startdate=CONCAT(GETDATE(FORMAT3),"-",GETDATE(HOUR),":",GETDATE(MIN),":",GETDATE(SEC))
^
When I delete all of the code -->
(startdate=CONCAT(GETDATE(FORMAT3),"-",GETDATE(HOUR),":",GETDATE(MIN),":",GETDATE(SEC))
startmessage=CONCAT("Script Started: ",startdate)
print(startmessage)
the entire script works fine.

I am using ScriptFTP 3.3 Build 30/09/2009

Any assistance will be greatly appreciated.

Sasha
It is a syntax error. That script seems to be written for a very old version of ScriptFTP. You need to add $ before every variable and remove CONTAT (no longer used by should still work) with dots :
FTP Script
  1. $startdate=GETDATE(FORMAT3)."-".GETDATE(HOUR).":".GETDATE(MIN).":".GETDATE(SEC)
  2. $startmessage="Script Started: ".$startdate
  3. print($startmessage)
You can find more information here:
http://www.scriptftp.com/reference.php?go=topic108

But feel free to post again if you need more help
Hi again,

thank you very much for your assistance.
I tried what you gave me, and to be honest, i am not versed at any type of Programming Language, so i tried my best.
It worked, but to a point. I am seeing that the script is changing the file name and appending the date at the end of it, however, it is not placing it in the folder for it to be picked up to be placed on the ftp site.

Do you mind if you can take a look at the code and let me know what i am doing wrong? If not, that's ok.

FTP Script
  1. # Get the current date
  2. $current_date=GETDATE(FORMAT3)
  3.  
  4.  
  5. # Build the zip filename
  6. # concatenating text strings
  7. $zip_file_name="FILENAME".$current_date.".zip"
  8.  
  9.  
  10. # Build the command line
  11. $command_line="G:\script\FFWEB\zipup.bat J:\reports\FILENAME J:\Magna\reports\FILENAME.csv -r ".$zip_file_name." J:\report\Magna_Customer_Levels_Listing-".$current_date.".zip"
  12.  
  13. #THE ABOVE CHANGED THE FILENAME FROM .csv TO .zip
  14.  
  15.  
  16. # Create the zip file
  17. EXEC($command_line)
  18.  
  19.  
  20. # Connect to FTP server
  21. OPENHOST("ftp.SITE.com","USERNAME","PASSWORD")
  22.  
  23. # Go back to passive mode
  24. SETPASSIVE(ENABLED)
  25.  
  26. # Use Active Mode
  27. #SETPASSIVE(DISABLED)
  28.  
  29. #change working directory
  30. CHDIR("FOLDERNAME1/")
  31.  
  32.  
  33. PUTFILE($zip_file_name)
  34.  
  35. #change working directory
  36. CHDIR("..")
  37.  
  38. #change working directory
  39. CHDIR("FOLDERNAME2/")
  40.  
  41. PUTFILE($zip_file_name)
  42.  
  43. # Transfer finished, close the connection
  44.  

Thanking you in advance, once again,
Sasha
Hello Sasha,

I copied and pasted your script in a notepad, saved it as .ftp and found no error running it under ScriptFTP. :roll: Not sure why you are getting that EOF error.

The script file is attached just in case you need it.
Attachments
(885Bytes)Downloaded 486 times