|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Batch backup
Ok I have a bat file on all computers here where I work. I am not the original author and he no longer works here. Now I do know what the file does but I did have a few questions on it. I have never done any batch programming so I have no clue about how to do what Id like to do... so to start with here is the code.
PHP Code:
If its possible I would like to get a text file that displays an exact copy or "echo" if you will of what the program displayed in the DOS window. That way if there are any errors or something not found I can take a look at the file and see how the program ran from beginning to end. Is there a way to do this and if so how? Thanks for the help |
|
#2
|
||||
|
||||
|
When you run the batch file put > filename at the end of the call
So mybatch.bat > c:\batchlog.txt That will write the output to that file >> appends a file, so it will keep adding to the end mybatch.bat >> c:\batchlog.txt For example
__________________
medialint.com "Energy has the opportunity to change the climate if it's done right." - Sen. John Ensign, R-Nev. (quoted out of context) |
|
#3
|
|||
|
|||
|
Ok thanks alot, I will give that a shot.
|
|
#4
|
|||
|
|||
|
Is there anyway I can just capture certain parts? On most systems that this bat will run on the files will be small but on a few the txt file will be huge. One of my systems the text file came out to being 30MB. I dont realy need ALL the output I guess but if I could see just the errors, that would be perfect. Now the errors may be different frommachine to machine, so if I know what I need to do in this case im sure I can customise the rest as i go.
So if this is possible to capture JUST the errors, this is what format the error is I am getting now on one of my systems. zip warning: name not matched: c:/download/download RW/Rotating Images another example from the same system/script is this... zip warning: name not matched: c:\documents and settings\jeff\application data\mozilla\Firefox\Profiles\kemdc009.default\bookmarks.html So if there is a way to capture and write anything that starts with "zip warning:" or something, to a txt file, that would be perfect and would prevent huge files containing all of the output. Besides it is pretty much the warnings and errors Im interested in anyway. Thanks so much for your help |
|
#5
|
|||
|
|||
|
well I got my script running the way I like but Im still wondering if there is a way to ONLY capture errors when they come up?
Thanks |
|
#6
|
|||
|
|||
|
Ok I just put a copy of this backup script onto a new laptop we just got. Everything works well but since this laptop wont be connected to the network 24 hours a day I need to find a way in the script, that once the backup is complete, to take the zip file which is in c:\download\4weeks\backup.zip and FTP it to /data on our linux machine.
How would I go about doing that? thanks for the help |
|
#7
|
|||
|
|||
|
well i figured this one out on my own to...thanks anyway
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Batch backup |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|