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

batch file -Daily schedule copy whole folder and rename by DATE

Hi,

I had daily job to copy  whole folder from Z:\DATA\SOURCE     to   D:\BACKUP\20091231  ,  rename the new folder   according YEAR & DATE------e.g.     "20091231" .

so i will had folders name:  20091228   , 20091229, 20091230, 20091231  ..................................................


How can i  command  a batch file to do backup---  scheduled  at 17:00  daily  ?

Thanks
Stanley
0
candychan611
Asked:
candychan611
  • 3
  • 3
2 Solutions
 
jeff_01Commented:
md D:\BACKUP\%date:~0,4%%date:~5,2%%date:~8,2%
xcopy /Y /Q /S Z:\DATA\SOURCE D:\BACKUP\%date:~0,4%%date:~5,2%%date:~8,2%

Copy and paste that into a batch file.

You can use Windows Task Scheduler to automatically run your batch file everyday at 17:00

0
 
jeff_01Commented:
0
 
candychan611Author Commented:
Thanks , it works and save time for me :)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
candychan611Author Commented:
Hi Jeff_01,

Your batch code  works when i click it manually.

After i setting this  at  TASK Scheduler then do nothing.
(Already  use other  software , it can open by TASK Scheduler normally )

Here is my path :   (Y drive is   NAS storage   Z drive is old   norvell netware  server  )

md Y:\FoxproserverBackup\%date:~0,4%%date:~5,2%%date:~8,2%
xcopy /Y /Q /S Z:\HKMDATA Y:\FoxproserverBackup\%date:~0,4%%date:~5,2%%date:~8,2%
0
 
jeff_01Commented:
Hmm, maybe its a permissions thing.

If you right click on the task then click properties.

In the RunAs section type your username and then click on set password and type in your password.

This will allow the task to run with your credentials. Try that and lets see what happens.



0
 
candychan611Author Commented:
Hi,

The reason of failure:   .bat place at a  FOLDER  names   included    space, marks  and  chinese character , it seems  not support.

After rename it  all fixed.
 
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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