EOF expected
4 posts
• Page 1 of 1
EOF expected
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:
When I delete all of the code -->
the entire script works fine.
I am using ScriptFTP 3.3 Build 30/09/2009
Any assistance will be greatly appreciated.
Sasha
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
- trinisasha
- Posts: 2
- Joined: 27 Sep 2011, 21:01
Re: EOF expected
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 :
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
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
- ScriptFTP support
- Site Admin
- Posts: 624
- Joined: 04 Aug 2008, 15:08
- Location: Burgos, Spain, EU
Re: EOF expected
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.
Thanking you in advance, once again,
Sasha
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.
# Get the current date
$current_date=GETDATE(FORMAT3)
# Build the zip filename
# concatenating text strings
$zip_file_name="FILENAME".$current_date.".zip"
# Build the command line
$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"
#THE ABOVE CHANGED THE FILENAME FROM .csv TO .zip
# Create the zip file
EXEC($command_line)
# Connect to FTP server
OPENHOST("ftp.SITE.com","USERNAME","PASSWORD")
# Go back to passive mode
SETPASSIVE(ENABLED)
# Use Active Mode
#SETPASSIVE(DISABLED)
#change working directory
CHDIR("FOLDERNAME1/")
SETUPLOADMODE(DIRECT)
PUTFILE($zip_file_name)
#change working directory
CHDIR("..")
#change working directory
CHDIR("FOLDERNAME2/")
PUTFILE($zip_file_name)
# Transfer finished, close the connection
CLOSEHOST
EXIT
$current_date=GETDATE(FORMAT3)
# Build the zip filename
# concatenating text strings
$zip_file_name="FILENAME".$current_date.".zip"
# Build the command line
$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"
#THE ABOVE CHANGED THE FILENAME FROM .csv TO .zip
# Create the zip file
EXEC($command_line)
# Connect to FTP server
OPENHOST("ftp.SITE.com","USERNAME","PASSWORD")
# Go back to passive mode
SETPASSIVE(ENABLED)
# Use Active Mode
#SETPASSIVE(DISABLED)
#change working directory
CHDIR("FOLDERNAME1/")
SETUPLOADMODE(DIRECT)
PUTFILE($zip_file_name)
#change working directory
CHDIR("..")
#change working directory
CHDIR("FOLDERNAME2/")
PUTFILE($zip_file_name)
# Transfer finished, close the connection
CLOSEHOST
EXIT
Thanking you in advance, once again,
Sasha
- trinisasha
- Posts: 2
- Joined: 27 Sep 2011, 21:01
Re: EOF expected
Hello Sasha,
I copied and pasted your script in a notepad, saved it as .ftp and found no error running it under ScriptFTP.
Not sure why you are getting that EOF error.
The script file is attached just in case you need it.
I copied and pasted your script in a notepad, saved it as .ftp and found no error running it under ScriptFTP.
The script file is attached just in case you need it.
- Attachments
-
yourscript.ftp- (931 Bytes) Downloaded 50 times
- ScriptFTP support
- Site Admin
- Posts: 624
- Joined: 04 Aug 2008, 15:08
- Location: Burgos, Spain, EU
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests

