?
Solved

I need a batch that move and FTP files on hourly bases

Posted on 2014-11-28
7
Medium Priority
?
243 Views
Last Modified: 2014-12-05
Hi,

I have two types of files that names like :

count_of_S_20141110.txt
count_of_S_20141111.txt

and other

count_of_g_20141110.txt
count_of_g_20141111.txt

what i'm looking for is a batch file to run every hour and:
1- FTP them to some remote location
2- move them from that current folder

thanks for the help
0
Comment
Question by:hi4ppl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 25

Expert Comment

by:NVIT
ID: 40471330
What OS?
a batch file to run every hour
You can use the Task Scheduler for this.

move them from that current folder
Move to where?
0
 
LVL 1

Author Comment

by:hi4ppl
ID: 40471350
Hi,

current folder :

D:/data/

move to

D:/backup/s ** for S files
D:/backup/g ** for G files

regards
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 40471357
so is this ftp as in the question, or just a mapped drive?

if it is a mapped drive then a unc path \\server\share would be best as the drive mapping wouldnt be available to a scheduled task.

Is there any remaining involved or just look for those files and move them to the other location?

is there any chance they could still be being written to when the script runs? If there is would  suggest the other process could flag completion or only rename the file when it has finished.

If you did this process manually how do you do it?

Steve
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 25

Accepted Solution

by:
NVIT earned 2000 total points
ID: 40471381
hi4ppl,

Will your .txt files always have unique names that won't conflict with other files at the ftp and D:/backup ends?
If not, you either have to delete or rename them before sending them.

Do you need ftp examples? See Steve's examples at http://scripts.dragon-it.co.uk/links/batch-ftp-scripting

Assuming the .txt files are always unique, your batch files could look like...

cd d:\data

( Do ftp stuff here )

move count_of_S_*.txt d:\backup\s
move count_of_G_*.txt d:\backup\g

Open in new window


For the task scheduler GUI, the steps differ a bit, depending on the OS.

If you want to make and control the task via the command line:

XP: http://www.windowsnetworking.com/kbase/WindowsTips/WindowsXP/AdminTips/Utilities/XPschtaskscommandlineutilityreplacesAT.exe.html

Windows 7: http://technet.microsoft.com/en-us/magazine/ff356867.aspx

[Steve: edited to change link to permanent one for script site]
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 40472892
There is an extension called ftpuse, which works like net use but for FTP, and can simplify access if you need to do more than just push files into FTP. Checking for existence, for example.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 40473159
@Qlemo - that sounds potentially useful, put in the toolbox :-)
0
 
LVL 25

Expert Comment

by:NVIT
ID: 40483411
hi4ppl... Thanks for the update. I'm glad we could help.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question