Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Want to create a back up

Posted on 2006-11-05
16
Medium Priority
?
170 Views
Last Modified: 2010-04-12
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
Comment
Question by:eteran
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
  • 2
16 Comments
 
LVL 16

Expert Comment

by:glenn_1984
ID: 17877553
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
 

Author Comment

by:eteran
ID: 17877917
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
 
LVL 16

Expert Comment

by:glenn_1984
ID: 17878250
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 16

Expert Comment

by:glenn_1984
ID: 17878257
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
 

Author Comment

by:eteran
ID: 17878351
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
 
LVL 16

Expert Comment

by:glenn_1984
ID: 17878380
You are correct.
Double click the icon on your desktop, that is...not the pasted text in Notepad.
0
 

Author Comment

by:eteran
ID: 17878410
What about echo off can you place in detail all the stuff it should have
I am new to these things
0
 
LVL 16

Accepted Solution

by:
glenn_1984 earned 2000 total points
ID: 17878602
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
 

Author Comment

by:eteran
ID: 17879008
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
 

Author Comment

by:eteran
ID: 17879025
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17880260
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17880263
Don't give me points for that btw, was just passing!!
0
 

Author Comment

by:eteran
ID: 17882683
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
 
LVL 16

Assisted Solution

by:glenn_1984
glenn_1984 earned 2000 total points
ID: 17883168
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
 

Author Comment

by:eteran
ID: 17883852
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
 
LVL 16

Expert Comment

by:glenn_1984
ID: 17883983
Remove the info below from your file

(order by date oldest first)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 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