Hi,
Anyone can help me on how to pass the current using ftp. The file I have on my Unix OS to get the file YYYMMDD.txt. Everyday will get the current file using the said format.
Here is my batch file ;
REM ftpconnect.bat
ftp -i -s:c:\putfilehere\ftpconnect.prg server1
REM ftpconnect.prg
myuser
mypassword
bin
hash
prompt
cd /getfilehere
get YYYYMMDD.txt
bye
Thanks in Advance,
Ferdie
FTP to pass current date
Moderator: DosItHelp
Resolved
Hi,
Resolved, these could help others.
@echo off
Rem Enable delayed execution
Setlocal ENABLEDELAYEDEXPANSION
Rem Store Server Variable
Set FTPSite=111.111.1.1
Rem Store Login User
Set uname=myusername
Rem Store Password User
Set password=mypassword
Rem Store YYYYMMDD 'YearMonthDay'
Set Year=%date:~-4%
Set Month=%date:~4,2%
Set Day=%date:~7,2%
Rem Combined all Dates Variables
Set MyDateVar=%Year%%Month%%Day%
Rem Connect to Server
echo open %FTPSite%>.\ftp.scr
echo %uname%>>.\ftp.scr
echo %password%>>.\ftp.scr
Rem Store backup current date file
echo get filetobackup-%mydatevar%.txt>>.\ftp.scr
Rem Close Connection
echo bye>>.\ftp.scr
Rem Execute script for backup current file
ftp -i -s:ftp.scr>.\ftp.log
Endlocal
Thanks/Ferdie
Resolved, these could help others.
@echo off
Rem Enable delayed execution
Setlocal ENABLEDELAYEDEXPANSION
Rem Store Server Variable
Set FTPSite=111.111.1.1
Rem Store Login User
Set uname=myusername
Rem Store Password User
Set password=mypassword
Rem Store YYYYMMDD 'YearMonthDay'
Set Year=%date:~-4%
Set Month=%date:~4,2%
Set Day=%date:~7,2%
Rem Combined all Dates Variables
Set MyDateVar=%Year%%Month%%Day%
Rem Connect to Server
echo open %FTPSite%>.\ftp.scr
echo %uname%>>.\ftp.scr
echo %password%>>.\ftp.scr
Rem Store backup current date file
echo get filetobackup-%mydatevar%.txt>>.\ftp.scr
Rem Close Connection
echo bye>>.\ftp.scr
Rem Execute script for backup current file
ftp -i -s:ftp.scr>.\ftp.log
Endlocal
Thanks/Ferdie
Re: FTP to pass current date
Can i run an ftp server off of ubuntu linux or do i have to have an os specifically for servers? I want to set up an ftp server that can be accessed across the internet and im running ubuntu 11.04. Do i need to partition my hard drive and install a server os on it to set up an ftp server?
______________________________
keyword research ~ keyword tool
______________________________
keyword research ~ keyword tool