i need to write a script to copy backup data to a netwrok share day per day

hi guys,
i want to write a script that copies data from a specific directory in windows to a directory in a network share.and i want the script run daily(could be dne with task scheduler) but i need the copies to be named as the per the the date that it was taken. i hope i was clear in my request.Does anyone have a sample or template that i can use it have this script.thank to you all
sparks2000Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

snagsy1980Commented:
0
srawaleCommented:

"xcopy c:\data\* f:\backup\%date:~10,4%_%date:~4,2%_%date:~7,2%_backup\* /Y /Q /S" This is simple Windows Batch file and the task scheduler to create an automated daily backup.
 Save this command in notepad & save as backup.bat file.
 In this the xcopy commands will copy files and folders. The syntax for the command is xcopy [source] [destination] [arguments]. Where source is the folder that you want to backup and destination is the backup on the network drive. The arguments tell xcopy how to handle certain situations. For my script I used /Y to suppress prompting when overwriting files. If you do not include this the script will ask you before copying each file, that wouldnt be automated. /Q doesnt display the file names while copying. /S copies directories and sub directories. You can find more arguments by opening the command windows and typing xcopy /?.
%date:~10,4%_%date:~4,2%_%date:~7,2%_backup will create folder with current date.



0
kadadi_vIT AdminCommented:
Start>run>ntbackup and use the backup wizard as per your requirement daily/weekly & monthly basis.




Regards,

Vijay kadadi
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

sparks2000Author Commented:
dear srawale,
i did not get what are the 4,2%...and all the percentages .any way it did not work, it gave me anneror so i had to remove them.can u send it again please??
0
srawaleCommented:
hi Sparks

Rename this file as .txt to .bat  change folder name as your requirment.







backup.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sparks2000Author Commented:
when i run the script :xcopy c:\dell\* d:\backup\%date:~10,4%_%date:~4,2%_%date:~7,2%_backup\* /Y /Q /S

it gave me this message:
Invalid switch - /_00_backup\*

thanks
0
srawaleCommented:
xcopy c:\dell\* d:\backup\%date:~10,4%_%date:~4,2%_%date:~7,2%_backup\* /Y /Q /S

In this script all data of c:\dell folder will copied to d:\backup folder with current year_current month_current date_backup folder in short script will create the destination folder as d:\backup\2008_02_06_backup.

  You cross check the command again. as per my eariler attachment.
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.