Solved

Backup files automatically

Posted on 2007-04-02
19
251 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
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: 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
 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
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…
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). …

770 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