- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- transfer just last generated files using ftp from ...
Operating System - Microsoft
1748216
Members
3598
Online
108759
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-23-2008 12:19 AM
тАО05-23-2008 12:19 AM
transfer just last generated files using ftp from win machine
Hi all,
after connecting to windows ftp server, I would like to transfer files that are last generated, I mean last ones according date. In linux/unix I know it is possible to do something like ls -s | awk '{ print $1, $ time field } ' and select files for transfer. But I do not know to do the same on windows after connecting. I google-ed, but still did not find some solution.
Also, when I after connecting to win machine issue cd c:\ I got, ftp> cd c:/
550 c:/: The filename, directory name, or volume label syntax is incorrect
Can you suggest, what is wrong with this command, it is stated in microsoft help page as
correct sintax.
Thanks in advande,
with regards,
after connecting to windows ftp server, I would like to transfer files that are last generated, I mean last ones according date. In linux/unix I know it is possible to do something like ls -s | awk '{ print $1, $ time field } ' and select files for transfer. But I do not know to do the same on windows after connecting. I google-ed, but still did not find some solution.
Also, when I after connecting to win machine issue cd c:\ I got, ftp> cd c:/
550 c:/: The filename, directory name, or volume label syntax is incorrect
Can you suggest, what is wrong with this command, it is stated in microsoft help page as
correct sintax.
Thanks in advande,
with regards,
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-23-2008 04:48 AM
тАО05-23-2008 04:48 AM
Re: transfer just last generated files using ftp from win machine
Hi index ;-),
In windows you can use script which are also same/more powerful as script on linux.
for example you wanna list all file creation list write a file double click to run:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set FileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='c:\Logs'} Where " _
& "ResultClass = CIM_DataFile")
For Each objFile In FileList
strDate = Left(objFile.CreationDate, 8)
Wscript.Echo strDate
Next
//++++++++++++++++++++++++++++++
It will display all dates you can do manipulation and anything.
Now your ftp issue?
Did you setup a FTP server and client?
files you are transferring need ftp service on target too?
In windows you can use script which are also same/more powerful as script on linux.
for example you wanna list all file creation list write a file
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set FileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='c:\Logs'} Where " _
& "ResultClass = CIM_DataFile")
For Each objFile In FileList
strDate = Left(objFile.CreationDate, 8)
Wscript.Echo strDate
Next
//++++++++++++++++++++++++++++++
It will display all dates you can do manipulation and anything.
Now your ftp issue?
Did you setup a FTP server and client?
files you are transferring need ftp service on target too?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-23-2008 12:54 PM
тАО05-23-2008 12:54 PM
Re: transfer just last generated files using ftp from win machine
Thanks for update. I resloved problem related to ftp, I can transfer files form client to server and vice-versa. Now, I am playing to find some way to transfer just last generated file from script in win. scheduler. Any idea is welcome.
With regards,
With regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-25-2008 10:37 PM
тАО05-25-2008 10:37 PM
Re: transfer just last generated files using ftp from win machine
see win script is very flexible and very powerful; even u don't need ftp to copy over network. anyways up to u.
see this exapmple you can run SQL queries here:
+++++++++++++++++++++++++++++++++
Set objLogParser = CreateObject("MSUtil.LogQuery")
Set objInputFormat = CreateObject("MSUtil.LogQuery.FileSystemInputFormat")
objInputFormat.Recurse = 0
Set objOutputFormat = CreateObject("MSUtil.LogQuery.NativeOutputFormat")
objOutputFormat.rtp = -1
strQuery = "SELECT Name, CreationTime FROM 'C:\Scripts\*.*' " & _
"WHERE NOT Attributes LIKE '%D%' ORDER BY CreationTime"
objLogParser.ExecuteBatch strQuery, objInputFormat, objOutputFormat
++++++++++++++++++++++++++++++++
which can sort ur directory to creation date. now u can write query to list only file which are less than a specified date. and put them in a array and copy those.
+++++++++
To copy over network:
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive "Z:", "\\atl-fs-01\Public" +++ map the drive
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\Scripts\Test.txt", "Z:\" +++ copy files
objNetwork.RemoveNetworkDrive "Z:" ++ disconnect again.
+++DONE
Hope u will play more with script and get ur work done as well as learnings.
see this exapmple you can run SQL queries here:
+++++++++++++++++++++++++++++++++
Set objLogParser = CreateObject("MSUtil.LogQuery")
Set objInputFormat = CreateObject("MSUtil.LogQuery.FileSystemInputFormat")
objInputFormat.Recurse = 0
Set objOutputFormat = CreateObject("MSUtil.LogQuery.NativeOutputFormat")
objOutputFormat.rtp = -1
strQuery = "SELECT Name, CreationTime FROM 'C:\Scripts\*.*' " & _
"WHERE NOT Attributes LIKE '%D%' ORDER BY CreationTime"
objLogParser.ExecuteBatch strQuery, objInputFormat, objOutputFormat
++++++++++++++++++++++++++++++++
which can sort ur directory to creation date. now u can write query to list only file which are less than a specified date. and put them in a array and copy those.
+++++++++
To copy over network:
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive "Z:", "\\atl-fs-01\Public" +++ map the drive
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\Scripts\Test.txt", "Z:\" +++ copy files
objNetwork.RemoveNetworkDrive "Z:" ++ disconnect again.
+++DONE
Hope u will play more with script and get ur work done as well as learnings.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP