Backup files automatically

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
LVL 11
bsharathAsked:
Who is Participating?
 
sirbountyConnect With a Mentor Commented:
Hmm - it works with one file, but not with multiple?
Perhaps try

@xcopy "F:\India List\*.*" "c:\India list\" /y
0
 
sirbountyCommented:
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
 
LauraEHunterMVPCommented:
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
sirbountyCommented:
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
 
bsharathAuthor Commented:
Windows 2003
0
 
sirbountyCommented:
Then the schtasks route should work fine...
0
 
bsharathAuthor Commented:
Will this back up  the file every 1hr
0
 
sirbountyCommented:
Yes, my example above 'starts' at 9am - but you can change that to any starting time...(the /st parameter)
0
 
bsharathAuthor Commented:
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
 
sirbountyCommented:
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
 
bsharathAuthor Commented:
This worked thanks how can i do it for the whole folder or its contents in it.
0
 
sirbountyCommented:
Just change the batch file to xcopy instead of copy...

@xcopy "c:\sourcefolder\" "c:\targetfolder\" /y
0
 
bsharathAuthor Commented:
Will this go on overwriting the folder every 1 hr
0
 
sirbountyCommented:
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
 
bsharathAuthor Commented:
This did not work
This is the path
@xcopy "F:\India List\" "c:\India list\" /y
0
 
sirbountyCommented:
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
 
bsharathAuthor Commented:
F: is a local drive in my machine
0
 
bsharathAuthor Commented:
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
 
sirbountyCommented:
Sure.
Glad I could assist you here. :^)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.