Solved

Backup files automatically

Posted on 2007-04-02
19
248 Views
Last Modified: 2010-03-05
Hi,

I want to schedule to backup 1 file every 1 hr.Excel file.How can i do this.With a windows inbuilt component.

THX
SHarath
0
Comment
Question by:bsharath
  • 10
  • 8
19 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18836724
On what OS?

From a command line, this should work:

schtasks /create /ru System /sc hourly /st 09:00:00 /tn Backup /tr "cmd /c copy c:\sourcefolder\file.xls c:\targetfolder /y"
0
 
LVL 30

Expert Comment

by:LauraEHunterMVP
ID: 18836726
Use the ntbackup command-line utility (syntax available here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntbackup_command.mspx?mfr=true), or click on the "Backup" icon under Accessories-->System Tools.

Hope this helps.

Laura E. Hunter - Micorosft MVP: Windows Server - Networking
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18836736
Or, within the GUI version (in control panel) define the schedule task, but just precede the 'run' command line with
cmd /c
This is because 'copy' is an internal command and must be passed through the command interpreter (cmd)
0
 
LVL 11

Author Comment

by:bsharath
ID: 18836800
Windows 2003
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18836819
Then the schtasks route should work fine...
0
 
LVL 11

Author Comment

by:bsharath
ID: 18836840
Will this back up  the file every 1hr
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18836871
Yes, my example above 'starts' at 9am - but you can change that to any starting time...(the /st parameter)
0
 
LVL 11

Author Comment

by:bsharath
ID: 18840882
sirbounty:

I use windows 2003 it seems it does not work.

Can you give it as any file in the folder to copy to a new location.

THX
Sharath
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18840900
What results did you see?
Of course, the sourcefolder and targetfolder paths will need to be changed, and the file.xls will need to be your file.  The only thing I can think of right now is that maybe your path has spaces in it?  If so, post the full path(s) please and I'll help you get it working...

Otherwise, you might simply create a small batch file and call it.

1) Create the batch file - save it as c:\backup.bat
In this file, you'll only have one line:
@copy "c:\sourcefolder\file.xls" "c:\targetfolder\" /y

2) Schedule it to run
schtasks /create /ru System /sc hourly /st 09:00:00 /tn Backup /tr "cmd /c c:\backup.bat"
0
Are end users causing IT problems again?

You’ve taken the time to design and update all your end user’s email signatures, only to find out they’re messing up the HTML, changing the font and ruining the imagery. What can you do to prevent this? Find out how you can save your signatures from end users today.

 
LVL 11

Author Comment

by:bsharath
ID: 18840924
This worked thanks how can i do it for the whole folder or its contents in it.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18840925
Just change the batch file to xcopy instead of copy...

@xcopy "c:\sourcefolder\" "c:\targetfolder\" /y
0
 
LVL 11

Author Comment

by:bsharath
ID: 18840935
Will this go on overwriting the folder every 1 hr
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18840937
Yes, the /y determines that it overwrites without prompting.
If the scheduled task is set to recur every hour, it will fire that batch file every hour...
0
 
LVL 11

Author Comment

by:bsharath
ID: 18840943
This did not work
This is the path
@xcopy "F:\India List\" "c:\India list\" /y
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18840957
Is F a mapped drive?
If so, you won't be able to use SYSTEM for the /ru parameter...you'll need to substitute
/ru SYSTEM
for
/ru Domain\Username /rp Password
in order for it to work.

You may also need to adjust your batch file to either map the drive or simply use the UNC path:

@xcopy "\\Server\Share\India List\" "c:\India list\" /y
0
 
LVL 11

Author Comment

by:bsharath
ID: 18840974
F: is a local drive in my machine
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18840979
Hmm - it works with one file, but not with multiple?
Perhaps try

@xcopy "F:\India List\*.*" "c:\India list\" /y
0
 
LVL 11

Author Comment

by:bsharath
ID: 18840990
Great this worked.Thanks a lot for the support.

I have some questions posted which may require your help can you please look into it.

THX
Sharath
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18840994
Sure.
Glad I could assist you here. :^)
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now