FTP to pass current date

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
fspalero
Posts: 2
Joined: 09 Mar 2009 04:03
Location: macau
Contact:

FTP to pass current date

#1 Post by fspalero » 09 Mar 2009 04:18

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

fspalero
Posts: 2
Joined: 09 Mar 2009 04:03
Location: macau
Contact:

Resolved

#2 Post by fspalero » 10 Mar 2009 19:58

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

womariya
Posts: 2
Joined: 28 Jul 2011 03:46

Re: FTP to pass current date

#3 Post by womariya » 31 Jul 2011 01:38

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

Post Reply