• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Batch File

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Techies,


I want to create a batch file to automatic download logs from remote server over internet.I checked it out on google ,but not find out any appropriate help to proceed further.
Please help me in creating this.




Thanks,
Rahul
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you can elaborate your question more clearly, we may be able to help. Nevertheless, you can try tools like ftp, scp, wget, etc.
 
Saloon Keeper
Posts: 28496
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DOS has batch files. Linux has scripts.
 
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
inside your 'batch file" or shell script, you will want to use a commands such as either wget or curl
 
Rahul Sud
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on windows so i want to create a batch file , which on particular run download all the log files from remote server via internet and store on given path directory in my system (remote server is on different country).

This is all about where i need help.


Thanks,
Rahul
 
Pat Farrell
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rahul Sud wrote:I am working on windows so i want to create a batch file


When I need to do complicated stuff in a Windows cmd script, I use perl. Check out ActiveState's open source perl.

Perl has the fundamental primitives to do the stuff you want, fairly easily.
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rahul Sud wrote:I am working on windows so i want to create a batch file , which on particular run download all the log files from remote server via internet and store on given path directory in my system (remote server is on different country).

This is all about where i need help.



What services does the server offer?
Are you free to decide that?
Is the server running linux?

There are a lot of ways to solve the problem - maybe you can configure the logger to send the logs via email. You can offer a ssh-daemon, which can be accessed automatically by shared keys, and you could get the files with scp.

http://en.wikipedia.org/wiki/Secure_copy

I don't see much room for perl, btw.

And 'batch-file' seems to me to be a perfectly reasonable name - a script might be a batch file, if it doesn't use threads, which sounds pretty reasonable for this kind of job - do one command after the other.

http://en.wikipedia.org/wiki/Batch_processing
 
Tim Holloway
Saloon Keeper
Posts: 28496
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know I sound pedantic, but while "Batch file" is a term that may have been used on some mainframes, for most people it has always meant a DOS script (".BAT"). It's worth remembering, because people on less polite forums flame you for less than that. Mostly because they're jerks, but the BAT command processor is pretty brain-dead compared to your average scriptable shell. Linux has a "batch" capability, but it refers to batch in the sense that processing is non-interactive, not the act of scripting.

Of course, these days, Windows has the incredibly stupid batch shell (COMMAND.COM), the merely stupid batch shell (CMD.EXE) and the "look-at-me" Windows Scripting shell, which I've never actually used myself.

Even a COMMAND.COM .BAT file can download a set of files, though. All that is required is that the host make them available via FTP. The Windows command-line FTP client (named, "FTP") can accept FTP batch commands and process them. "FTP Batch commands" isn't the same as a BAT file. It simply means a canned set of FTP commands in a text file that's read and processed by FTP. Unlike BAT files, which are read and processed by COMMAND.COM.
 
Rahul Sud
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

First of all thanks to all for the comments.But i need more clarification as i have not much idea about the batch file etc.

My Original question was this :

I am working on windows so i want to create a batch file , which on particular run download all the log files from remote server via internet and store on given path directory in my system (remote server is on different country).




I will make it more elaborated.
Currently I am downloading logs via ssh FTP tool by manually click on that each time and save it in the specified folder.This is downloading logs from say Country X and I am in Country Y via a particular internet address with user id,password and port.
I don't want to do monitoring and want to do this work automate with batch file.So that whenever i need to download logs or file from ssh(server) which is on linux to my workstation which is on windows it will process in the automate way without any continuous monitoring.


This is all about where i need help.



Thanks,
Rahul


 
Tim Holloway
Saloon Keeper
Posts: 28496
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. Sounds like you should get the "pscp" program from the PuTTY project.

You shouldn't actually need a batch file, since pscp can copy multiple files over ssh. Or if you do use a batch file, the only thing in it would be the "pscp" command line.
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic