AOA Forums AOA Forums AOA Forums Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA Forums > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!


Reply
 
LinkBack Thread Tools Rate Thread
  #1 (permalink)  
Old 17th March, 2009, 02:33 AM
Rondog's Avatar
Member
 
Join Date: January 2005
Location: Victoria, Australia
Posts: 3,298
Send a message via MSN to Rondog

Backup from batch file - please critique

Can someone please give me some feedback on my backup batch file?

Cheers

Code:
@ECHO off
cd\
g:
md email
echo.
md database
echo.
md documents
echo.
md "neis important docs"
echo.
md desktop
echo.
xcopy "c:\documents and settings\owner\local settings\application data\microsoft\outlook\*.*" g:\email
echo.
xcopy "C:\Documents and Settings\Owner\My Documents\*.mdb" g:\database
echo.
xcopy "C:\Documents and settings\owner\my documents\*.doc" g:\documents
echo.
xcopy "C:\Documents and settings\owner\my documents\*.docx" g:\documents
echo.
xcopy "C:\Documents and settings\owner\my documents\*.pdf" g:\documents
echo.
xcopy "C:\Documents and settings\owner\my documents\*.xls" g:\documents
echo.
xcopy "C:\Documents and settings\owner\my documents\*.rtf" g:\documents
echo.
xcopy "C:\Documents and Settings\Owner\My Documents\Neis Important Docs" "g:\neis important docs" /s /i
echo.
xcopy "E:\Documents and Settings\Amelia Dohnt\My Documents\Converted ABDCData.mdb" g:\database
echo.
xcopy "C:\Documents and Settings\Owner\Desktop" g:\desktop /s /i
echo.
pause
__________________
AOA Team fah

Rig 1: Intel Core i5 750,4gb,HD6870,500gb,W7 Ult x64
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 17th March, 2009, 05:35 PM
Chief Systems Administrator
 
Join Date: September 2001
Location: Europe
Posts: 13,075

You need to give some more information - what's the scenarios you will be using this? How does the restore work? What kind of file/files are you intending to back up.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 18th March, 2009, 09:07 AM
Rondog's Avatar
Member
 
Join Date: January 2005
Location: Victoria, Australia
Posts: 3,298
Send a message via MSN to Rondog

Its just going to be used to backup one PC to a portable USB hard drive. It is only temporary and only needs to last until June. Backup includes 1 PST file, numerous .doc and .docx and thats about it. All it is for, if the PC goes down, work can continue from another location.
__________________
AOA Team fah

Rig 1: Intel Core i5 750,4gb,HD6870,500gb,W7 Ult x64
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 18th March, 2009, 02:12 PM
Chief Systems Administrator
 
Join Date: September 2001
Location: Europe
Posts: 13,075

I just wondered why you didn't copy the whole of the \documents and settings\userid\ across?
Tools like Rsync can do a compare then copy, so that they only copy files that have changed. This helps speed things up.

How do you intend to restore the data if the system dies? Have you tested the plan?
__________________

Last edited by Áedán; 18th March, 2009 at 02:12 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 18th March, 2009, 02:24 PM
Rondog's Avatar
Member
 
Join Date: January 2005
Location: Victoria, Australia
Posts: 3,298
Send a message via MSN to Rondog

Yes its been tested. Systems are very similar, it can be just copied back as easily. Reason for not copying entire user ID is size limits. The client is on a government contract which ends in June and they are unsure at this stage if it will be renewed. If it gets renewed, they will be purchasing a server with tape back up. So it is only required to backup mission critical data until then.
__________________
AOA Team fah

Rig 1: Intel Core i5 750,4gb,HD6870,500gb,W7 Ult x64
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 19th March, 2009, 03:03 AM
danrok's Avatar
AOA Staff
 
Join Date: March 2003
Location: Great Britain
Posts: 18,917

It might be worth adding some error handling.

Also, a message and pause, at the start, telling them to ensure the USB drive is connected.
__________________
Desktop PC: AMD FX-8370E / Asus M5A99X Evo R2.0 Motherboard / 16GB DDR3 RAM / GeForce GTX 970
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 19th March, 2009, 06:22 AM
Rondog's Avatar
Member
 
Join Date: January 2005
Location: Victoria, Australia
Posts: 3,298
Send a message via MSN to Rondog

Ahah, good idea thanks danrok!

However, I do not understand what you mean by error handling?
__________________
AOA Team fah

Rig 1: Intel Core i5 750,4gb,HD6870,500gb,W7 Ult x64
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 30th March, 2009, 11:25 PM
danrok's Avatar
AOA Staff
 
Join Date: March 2003
Location: Great Britain
Posts: 18,917

You can use the IF ERRORLEVEL command, to handle errors.

DOS commands will set ERRORLEVEL depending on what happened when they were executed.
__________________
Desktop PC: AMD FX-8370E / Asus M5A99X Evo R2.0 Motherboard / 16GB DDR3 RAM / GeForce GTX 970
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
batch file , programming



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New PS3 Owners Discover Noisy, Defective Console Batch Samuknow General Hardware Discussion 0 12th April, 2007 01:15 PM
Good tool for batch processing of images? danrok Digital Image, Photo, Video and Audio Editing. 6 31st May, 2004 04:07 AM
Using % in batch files Áedán Programming and Assembly Language 1 18th August, 2002 02:20 PM


All times are GMT +1. The time now is 02:49 AM.


Copyright ©2001 - 2010, AOA Forums
Don't Click Here Don't Click Here Either

Search Engine Friendly URLs by vBSEO 3.3.0