Solved

Backup files automatically

Posted on 2007-04-02
19
249 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found listed in my profile here: http:…
The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

911 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

22 Experts available now in Live!

Get 1:1 Help Now