• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Want to create a back up

Hey is there away with the schudular task forme to set up a copy of a folder or drive to onther computer. if so how do I create the bath file to do this. and everynight in copyes it dose not append but it just writes over
0
eteran
Asked:
eteran
  • 7
  • 7
  • 2
2 Solutions
 
glenn_1984Commented:
click on start
click on run
type notepad
and click ok

Lets assume you want to copy the data from c:\my documents\important\ to c:\backups on the same PC.
Your commands are:

xcopy "c:\my doucments\important\*.*" c:\backups\*.* /s /y /d

The /s = include all subfolders
/y = do not prompt to overwrite files
/d =only  copy files that are NEWER in the source folder.

Save the file to the desktop or anywhere you want with the extension .bat or .cmd  (i.e. backupimportant.bat)
Double click it to test.
Open Scheduled Tasks, browse for the filename and add it.

If you know how to share folders and map drives between PCs, to backup to another PC:

xcopy "c:\my doucments\important\*.*" k:\backups\*.* /s /y /d
k:= any drive letter of another pc
Instead of k: you could also share the backups folder on the other pc and use \\sharename\*.* etc.
0
 
eteranAuthor Commented:
OKay now /d =only  copy files that are NEWER in the source folder.
Does this mean that if something was modifiede it will also copy it to the back up folder??

0
 
glenn_1984Commented:
Yes, it will copy.
Once a program is modified, the date is changed to the date it was modified.

So, if I create a file called thisfile on  November 1, 2006 and add data to it on November 3, 2006, the date of the file is now 11/03/2006
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
glenn_1984Commented:
By all means, test your batch file after you create it.

The first time you run it, all files should copy.
If you then run it again, immediately after, nothing will copy.

If you want to verify the copy every day, add the following lines to the xcopy line above

@echo off
cls
dir targetdrive:\targetfolder\*.* /od   (order by date oldest first)
echo Please note time and date of files above.
pause

This will show you a list of the files copied, with the newest time and date files at the bottom of the list.
0
 
eteranAuthor Commented:
So step by step

1) open text file
2) paste xcopy "c:\my doucments\important\*.*" c:\backups\*.* /s /y /d
save it under .bat
and then doublke click it.

Is this it. I am new to this
0
 
glenn_1984Commented:
You are correct.
Double click the icon on your desktop, that is...not the pasted text in Notepad.
0
 
eteranAuthor Commented:
What about echo off can you place in detail all the stuff it should have
I am new to these things
0
 
glenn_1984Commented:
If you want to REVIEW the copy of files...use this:

xcopy "c:\my doucments\important\*.*" k:\backups\*.* /s /y /d
@echo off
cls
dir targetdrive:\targetfolder\*.* /od   (order by date oldest first)
echo Please note time and date of files above.
pause


If you just want the copy to run and close use this:

xcopy "c:\my doucments\important\*.*" k:\backups\*.* /s /y /d

Remember the line above is an example of syntax.  You must use YOUR source and target folders.
Try it out.
0
 
eteranAuthor Commented:
getting an error system can not find file


F:\promas*.*" x:\backups\*.* /s /y /d
@echo off
cls
dir X:\backups\*.* /od   (order by date oldest first)
echo Please note time and date of files above.
pause
0
 
eteranAuthor Commented:
sorry this is the one I am running
F:\*.*" x:\*.* /s /y /d
@echo off
cls
dir x:\*.* /od   (order by date oldest first)
echo Please note time and date of files above.
pause
0
 
Steve KnightIT ConsultancyCommented:
You have missed the xcopy command off first line...

xcopy F:\*.*" x:\*.* /s /y /d
@echo off
cls
dir x:\*.* /od   (order by date oldest first)
echo Please note time and date of files above.
pause
0
 
Steve KnightIT ConsultancyCommented:
Don't give me points for that btw, was just passing!!
0
 
eteranAuthor Commented:
Still getting the same error. FIle not found. F:\ is a local drive on the server and x is a mapped drive. Can this effect anything
0
 
glenn_1984Commented:
Remove the " from first command line.
You only need the " if you have multiple words in your folder name

Make sure you have space between f:\*.* and x:\*.*
0
 
eteranAuthor Commented:
Hey this is the final code, thanks for the help.

xcopy F:\*.* x:\*.* /s /y /d
@echo off
cls
dir x:\*.* /od   (order by date oldest first)
echo Please note time and date of files above.
pause
0
 
glenn_1984Commented:
Remove the info below from your file

(order by date oldest first)
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 7
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now