Wednesday, August 25, 2010

今日阅读心得

- 经验不是指发生在你身上的事,而是你如何处理发生在你身上的事情。你如何善用你的经历?不要浪费你的痛苦或喜乐,使用它来帮助别人。
- 不尝试,你永远不知道自己擅长什么。若不成功,就当作是一个实验,而非失败。

Wednesday, June 23, 2010

今日阅读心得

- 许多不同的职业都有可能是上天对你人生的旨意:但祂最关心的是无论你做什么,你以向基督的样式来做。
- 不要毫不思索就自然的去顺应周围的文化,反要定睛于神,你就会里外焕然一新。
- 灵命不会自动成长,需要刻意致力去达到。
- 必须想要,决心,努力,及坚持不断的成长。
- 要改变你的人生,首先要改变思想的方式。
- 所思所想要谨慎,因为你的生命是由你的思想塑造的。
- 要改变方向有一个更好,更容易的方法:更换你的自动导航器-即你的思考模式。
- 改变总是由心里开始,你的思想方式决定你的感觉;而你的感觉则影响你的行为。
- 自私的想法是罪恶的根源。
- 开始成熟的思想就是把焦点从自己转移到别人身上。

Wednesday, January 20, 2010

Simple Script to Schedule Backup

I am recently asked to improve/automate a manual backup job. What they did previously was to copy a complete folder from c:\xxx to f:\xxx manually everyday at 4:30pm, and what is more annoying was that the user was prompted every time if he/she was to overwrite the existing file in destination folder.

Here i managed to create a batch file which i believe will help anyone who needs to do this manually everyday.

Open Notepad, copy and paste the following lines to your notepad and save it as copy.bat
set copycmd=/y
XCOPY C:\temp\* D:\temp\ /i /s

In line 1, copycmd=/y tells the system not to prompt to ask overwrite whatever existed in destination folder. If you changed it to copycmd=/-y, then the system will prompt if you want to overwrite it.

In line 2, XCOPY allows you to copy files and/or directory trees to another folder. XCOPY is similar to the COPY command except that it has additional switches to specify both the source and destination in detail; where C:\temp\* is your source, D:\temp\ is your destination, /i means if in doubt always assume the destination is a folder e.g. when the destination does not exist, and /s means copy folders and subfolders.

Then last step, you open the Scheduled Tasks (Start->Accessories->System Tools->Scheduled Tasks in WinXP), double-click Add Scheduled Tasks, browse to your copy.bat, and finally define when you want the system to perform this task.

Hopefully this can help. Cheers...

Additional link: WindowsXP Command guide