Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old November 29th, 2007, 11:39 AM
therealcrazy8 therealcrazy8 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 56 therealcrazy8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 29 m 10 sec
Reputation Power: 2
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:
 C:progsunixtouch.exe download4weeks4weektmp.txt
del download4weeks4weektmp
.txt
C
:progsunixfind.exe download4weeks -mtime +29 -ctime +29 ! -name 4weeks -exec rm -"{}\" ;
del \download\4weeks\backup.zip
.\unix\zip -r c:\download\4weeks\backup.zip c:\download c:\progs\nightly.bat "
C:Documents and SettingsLeoApplication DataMozillaProfilesdefault5vhfjtyc.sltbookmarks.html" "C:Documents and SettingsLeoApplication DataMozillaProfilesdefault5vhfjtyc.sltmail" "C:Documents and SettingsLeoApplication DataMozillaProfilesdefault5vhfjtyc.slt*.mab" "C:Documents and SettingsLeoApplication DataMozillaProfilesdefault5vhfjtyc.sltprefs.js" "c:Docments and SettingsLeoMy Documents"
echo BACKUP_COMPLETED > c:\download\4weeks\backedup.txt
exit 


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

Reply With Quote
  #2  
Old November 30th, 2007, 02:29 PM
medialint's Avatar
medialint medialint is offline
spirit duplicator
Click here for more information.
 
Join Date: Apr 2004
Location: \\Firecrate\
Posts: 12,325 medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)  Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 3 Weeks 11 h 47 m 19 sec
Reputation Power: 2578
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)

Reply With Quote
  #3  
Old December 1st, 2007, 01:19 AM
therealcrazy8 therealcrazy8 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 56 therealcrazy8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 29 m 10 sec
Reputation Power: 2
Ok thanks alot, I will give that a shot.

Reply With Quote
  #4  
Old December 3rd, 2007, 01:44 PM
therealcrazy8 therealcrazy8 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 56 therealcrazy8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 29 m 10 sec
Reputation Power: 2
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

Reply With Quote
  #5  
Old December 10th, 2007, 11:39 AM
therealcrazy8 therealcrazy8 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 56 therealcrazy8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 29 m 10 sec
Reputation Power: 2
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

Reply With Quote
  #6  
Old December 14th, 2007, 03:19 PM
therealcrazy8 therealcrazy8 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 56 therealcrazy8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 29 m 10 sec
Reputation Power: 2
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

Reply With Quote
  #7  
Old December 17th, 2007, 09:47 AM
therealcrazy8 therealcrazy8 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 56 therealcrazy8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 29 m 10 sec
Reputation Power: 2
well i figured this one out on my own to...thanks anyway

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Batch backup


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway