PetEdge
asked on
NCFTPPUT - FTP script to copy dynamic file names
Hello,
I have a daily process which copies files to our FTP server. From there, the files should be FTP'd to another server.
Typically, I'll use syntax like the following:
ncftpput -f c:\scripts\loginCredential s.txt RemoteFolder \ "c:\transfer\out\fileToBeC opied.txt"
That's fine if the file name does not change. In this case, I'd like to either rename the file to include a date time stamp OR copy a file which has this already in it's name.
Directory: c:\transfer\out\
fileToBeCopied20150120_092 9.txt
fileToBeCopied20150119_092 9.txt
fileToBeCopied20150118_092 9.txt
In this case, I can't seem to get the ncftpput to work with a wild card - i.e., the file variable name.
Thanks in advance for the help.
Karen
I have a daily process which copies files to our FTP server. From there, the files should be FTP'd to another server.
Typically, I'll use syntax like the following:
ncftpput -f c:\scripts\loginCredential
That's fine if the file name does not change. In this case, I'd like to either rename the file to include a date time stamp OR copy a file which has this already in it's name.
Directory: c:\transfer\out\
fileToBeCopied20150120_092
fileToBeCopied20150119_092
fileToBeCopied20150118_092
In this case, I can't seem to get the ncftpput to work with a wild card - i.e., the file variable name.
Thanks in advance for the help.
Karen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Quick and thorough answer - very much appreciated.
Educated guess. Glad it worked.
ASKER
Either solution is acceptable. Your first solution with the wildcard worked beautifully; my script had been failing due to the quotes.
Fails:
ncftpput -f c:\scripts\loginCredential
Works:
ncftpput -f c:\scripts\loginCredential
Thanks!!
Karen