Go Back   PCMech Forums > Windows Support > Windows Legacy Support (XP and earlier)

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 09-09-2006, 11:20 PM   #1
Member (13 bit)
 
Floppyman's Avatar
 
Join Date: Mar 1999
Posts: 6,791
Windows Backup Scripts

Hi all,

I'm not sure if this is the right forum, but here it goes. I basically want to write a backup script that will run in windows and execute at 1:00AM daily or right before the machine shuts down (whichever comes first -- maybe I need two scripts?). This script will simply copy a couple directories to a network share (which will ultimately get backed up onto tape) and then continue the shutdown proceedure. Any idea how might go about writing this script (i.e. what tools I would need)? Thanks in advance.
Floppyman is offline   Reply With Quote
Old 09-11-2006, 06:16 AM   #2
Premium Member
 
Statica's Avatar
 
Join Date: Jun 1999
Posts: 9,231
Hi Floppyman:

There are a number of ways to go about it, and writing a script is fairly easy .. IMO however the best practice in this case is not to reinvent the wheel but use existing tools and scripts. For example check out Michael's (Horowitz) Backup Script.
a) It's a fairly comprehensive script
b) Well documented
c) Configurable, especially for your needs, allowing you to change variables real easily
d) Has links to all the tools needed to adapt the script to your needs. For example: Michael makes mention of Show Stopper .. a tool that allows you to run scheduled tasks on a shutdown.

HTH

Last edited by Statica; 09-11-2006 at 06:21 AM.
Statica is offline   Reply With Quote
Old 09-11-2006, 06:29 AM   #3
Member (9 bit)
 
Join Date: Mar 2001
Location: Illinois
Posts: 352
I wrote a batch file to do my backups, and then schedule it to run at midnight via the "Schedule Task" utility. Here's a sample line:
Quote:
xcopy D:\Bids\*.* q:\Bids /Y
You can add as many lines to the batch as you want, and they will run one after another. I have 10 folders I backup in my batch file, and it is very very quick (less than 2 minutes).

With my batch, it is set to run at midnight...I don't know if you could add a line to run before shutdown.
bozo is offline   Reply With Quote
Old 09-11-2006, 07:38 AM   #4
Premium Member
 
Statica's Avatar
 
Join Date: Jun 1999
Posts: 9,231
Quote:
Originally Posted by bozo
I wrote a batch file to do my backups, and then schedule it to run at midnight via the "Schedule Task" utility. Here's a sample line:You can add as many lines to the batch as you want, and they will run one after another. I have 10 folders I backup in my batch file, and it is very very quick (less than 2 minutes).
I'd use robocopy instead of xcopy especially for cron jobs, especially those having to deal with network locations (as per floppy's requirements).

Quote:
Originally Posted by bozo
With my batch, it is set to run at midnight...I don't know if you could add a line to run before shutdown.
Pretty simple, you can either use a 3rd party app such as that listed in my link from earlier post, or you can use your group policy editor (start > run > gpedit.msc)
Local Computer Policy > Computer Configuration > Windows Settings> Scripts (Startup/Shutdown) and add a shutdown script.
Statica is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


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

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



All times are GMT -5. The time now is 03:03 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2