年份: 2013

教你做一个精致的小女生 学生党请进(3)

exquisite-little-girls3-1
关于微笑。
笑容对于一个女生来说很重要,不要说最标准的微笑是露出八颗牙齿还是几颗牙齿,而是你从内心发出的笑. 笑是一个人最明显的标志,在家的时候对着镜子多联系联系吧,看看哪种微笑适合你。不过也不要随便笑或者是故意哈哈大笑,那样只会显得你轻浮。在别人的面前多笑笑会让别人对你的第一感很好,也会显得你非常自信

exquisite-little-girls3-2
务必结交三五死党(同性最好),否则有可能在头疼脑热时要汤没汤要水没水最后把嘴伸进热带鱼缸或马桶内解渴,或心脏病突发死在床上八天都没人发觉

exquisite-little-girls3-3
关于 姐妹。
个人认为女生和女生之间的友谊很微妙哦。 如果你是一个内向的女生,就去交一个性格偏外向的朋友吧! 女生有些心事是需要和朋友交流的,不过和朋友倾诉的同时也别忘记,什么都是互相的,也要去关心对方。
切记,勿交损友。 爱搬弄是非爱背后嚼舌头根的女生惹不起。也不要因为看不惯去指责她,有的时候装点怂也没什么

exquisite-little-girls3-4
关于 饮料。
语文老师说过,带颜色人工制作的饮料不要喝,因为你永远也不知道里面究竟添加了些什么。 其实偶尔喝一下解解馋也没什么哦。只不过不要让喝饮料变成一种习惯。 家里有榨汁机的女生可以自己做一些水果汁。看电视剧里面说里面加柠檬汽水会口感会更好,也不知道是不是真的

exquisite-little-girls3-5
巧克力
在别人的面前,尽量不吃一大块的巧克力,这样别人会很注意你的牙齿,最好吃小粒的巧克力,这样会显得你非常精致,含在嘴里很快就化了

exquisite-little-girls3-6
别翘二郎腿
别以为这样在别人的眼里是耍酷,其实别人的眼里只是“随便”两字,而且容易压迫神经,腿型变样

exquisite-little-girls3-7
秘密
有些心事只能自言自语,有些秘密只能讲给朋友,有些痛苦只能默默承受。
自己还是要靠自己拯救

exquisite-little-girls3-8
提高自信
1微笑;
2接受赞美;
3停止叨唠;
4提升肤质感;
5不断学习;
6反省;
7闻闻清新味道;
8经常鼓励自己;
9抛弃垃圾食品;
10改变发形;
11天天运动;
12树立积极信念;
13停止嫉妒;
14制造眼神接触;
15别再无精打采;
16告诉自己还年轻;
17充满感激;
18多多走路;

exquisite-little-girls3-9
不要在想让你哭的人面前哭

眼泪

很多时候别以为自己不哭别人就会以为是坚强了 其实还有逞强.想哭时候就哭吧 捂着脸 别人问你哭了么的时候 记得以微笑面对.

exquisite-little-girls3-10
关于 人际关系。
和那些在社会摸爬滚打N年的大人们我们是比不上。不过发没发现我们的世界也越来越现实? 是的!在我们之间人际关系也成为了一个让人苦恼的问题。 一个善良的女孩子会尽量做到大部分人满意。 为什么不说所有人?因为怎么做都会有一小部分爱找茬的人不爽。因为不是所有的都是人。 这点一定要明白。 不明白你的不要去理她。所以无论在什么时候什么阶段,人际关系第一名

exquisite-little-girls3-11
给人第一感的小秘诀
一:多微笑些,科学表明1秒微笑比5秒微笑好,1秒的微笑别人常常不注意,有时候微微翘起一个孤度,会显得你很气质。

二:少说点话,和别人在一起的时候多聆听别人的话,少少的时候说出自己的一些观点,这样每当你说话的时候别人也会很注意你。

三:衣衫,衣服是女人的奴隶,第一感的主要小部分有衣服,别人第一次见到你的时候,你的衣服是很干净的话,别人回给你的第一感加分,如果第一次不好,有点邋遢的话,以后的日子别人对你衣服的眼光或许没那么好

外在美
虽然说人不可貌相,但貌相的人还是挺多的、所以,外在美其实非常重要、
如果你在一所封闭式的学校,老师对奇装异服很敏感,那我们就尽量穿的清新淡雅,清爽怡人。(衣服的颜色根据各人情况而定,注:不要只穿自己喜欢的,要穿适合自己的。)

可以适当地带一些朴素的小配饰,让服饰看起来更加典雅、
对于化妆,,我提议尽量用纯天然的东西,例如:在睫毛根部涂鱼肝油,
平日里注意保养,到重要的场合再化淡妆,会有感觉。

1、买一瓶白醋,每次洗脸时,放一小盆水,倒上一鲜橙多盖那么多的醋

2、倒入水中调匀,扑到脸上,或者干脆把脸浸入好了,温水,凉水都可

3、然后把水倒掉,再开始正常的洗脸程序,用洗面奶

醋的妙用十二招

1、用醋洗脸肌肤娇艳:将脸洗净后在温水中加入20ml醋洗脸,再用清水冲洗;

2、用醋沐浴使皮肤光滑:将250ml的苹果醋倒入浴缸内,泡10分钟,宛如洗温泉,让肌肤保持健康的弱酸状态;

3、用醋漱口预防感冒:当你感到有些不舒服,好似感冒时,你可以倒20ml的醋于杯中,再以

润肤:将醋和蜂蜜各1至2汤匙,用温开水冲服,每天2至3次,按时服用,经常坚持,粗糙的皮肤就会变得光洁润滑。用香皂洗脸后,用加1匙醋的温水洗一次,再用清水洗一次,也有润肤的作用。将5份醋和1份甘油混合,经常涂擦面部皮肤,同样有润肤的功效。

祛斑:面部如果有雀斑、黑斑,将白术浸于白醋中,密封7天后取白术擦拭有雀斑和黑斑的部位,每天坚持使用,日久雀斑和黑斑会逐渐变浅甚至消褪。

白肤:面部皮肤过于黝黑的女性,洗脸和洗澡时在水中加一点醋,久而久之,皮肤就会变白。另外,还可以将250克新鲜黄豆,在500克醋中浸泡15天左右,每天吃5至10粒醋黄豆,对减褪面部色素沉着有效

2. 2在眼睫毛根部抹鱼肝油可以刺激睫毛生长
3. 3用白糖洗脸对去黑色痘印非常有效
4. 4安安洗面奶…… 效果好的我迎风流泪啊
5. 5酸奶+香蕉泥敷脸可以缩毛孔,超级有用
6. 6氯霉素注射液擦脸可使皮肤平滑
7. 7用藿香正气水洗头 头发会变好。啤酒洗头防干枯脱落
8. 8睫毛用棉签蘸着VE涂 睡前涂下 然后睡觉 效果很明显
9. 9眉毛淡而稀~生姜削成笔状 天天涂一次 会长浓
10. 10喝茶的时候一次泡个两袋,喝完了一边眼睛一个敷个20分钟,可以消眼袋和黑眼圈。对大眼袋的人很有效,最好在起床的时候做,还有,最好是绿茶或红茶。
11. 11仙人掌捣烂敷脸,有消炎嫩肤的作用。但是仙人掌有很多种,要那种捣烂后黏糊糊的
12. 12有一个“二丫”的网站,专门交流化妆品的,很好用
13. 13烫染受损的头发:用醋洗。方法:用洗发水洗头冲净,用醋兑水(1:5左右)浇头发,过5分钟冲掉,再上一些护发素冲洗。效果非常好,头发就没有那么柴了,而且会变黑。而且对染完红色头发的非常有用,染红色最后脱色成黄色,如果用上面那个方法,就不会脱成黄色而是棕色的,发色比较自然。

爱美的女孩一定要记住一句话;善良的女孩最美丽。
切记千万不要在背后说别人坏话,哪怕你跟他有深仇大恨,只要自己心里清楚就好了。

单纯的女孩儿虽然有时候也许会哭泣,但她还是最美丽的

exquisite-little-girls3-12
女孩子不要不会喝酒 但更不能总是喝酒 有时可以用牛奶和果汁代替 禁止在公众场合喝烈酒宝贝们

exquisite-little-girls3-13
不要以为吹泡泡很幼稚 其实这是体现你可爱的时候

exquisite-little-girls3-14
把你的不满都写在纸上 然后折成纸飞机 将它飞出去 相信我 你的心情会好点的

exquisite-little-girls3-15
如果是出去玩 请为自己穿一双舒服的鞋子 不要因为美丽而去穿那些高跟鞋

exquisite-little-girls3-16
男生跟女生不一样 男生不管到多老都有人爱 可女生青春已过就什么都没了 所以请不要轻易把自己的青春送给别人

exquisite-little-girls3-17
在手臂上刻字并不好 如果你连自己都保护不好还怎么要别人来爱你 对吗?

exquisite-little-girls3-18
女生要学会自己犒劳犒劳自己 例如给自己买一个很喜欢的东西

exquisite-little-girls3-19
女孩子不要太晚出去 要多为自己着想 这不叫自私

exquisite-little-girls3-20
不要总是骂人 即使被骂了也要等他骂完后再用一个微笑赢得整场比赛 与疯狗对骂的人你见过么 所以 千万不要当那个愚蠢的

exquisite-little-girls3-21
自己的初吻一定要保护好 不要轻易让别人夺走 至少要自己不会后悔

exquisite-little-girls3-22
每天早上喝一杯牛奶 不止会美容 还会让你长高哦

exquisite-little-girls3-23
女孩子不要太晚睡觉 这样不止会有黑眼圈 眼袋 精神也会很不好哦
经常用淘米水洗脸也可以减轻黑眼圈跟眼袋

exquisite-little-girls3-24
女孩子要懂得爱干净 每天必须要洗一次澡

exquisite-little-girls3-25
男女有别 不要总是跟男生们混在一起 但也不要不跟男生玩
如果有了男盆友。不怕他吃醋吗亲

exquisite-little-girls3-26
如果你爱的人不爱你 请放弃吧

exquisite-little-girls3-27
女孩子记得对每一个人好 不管他对你怎样 这是女孩子的基本礼貌

exquisite-little-girls3-28
结婚的那一天 一定要快乐 但是丈夫必须是你爱的

exquisite-little-girls3-29
每天树立小目标然后努力实现

exquisite-little-girls3-30
寂寞的时候,不要听慢歌,怀旧或者腻死在网上,站起来做运动或者去找朋友八卦

exquisite-little-girls3-31
买一个漂亮的灯,有创意一点的,可以买那种过节时挂在树上的灯,挂在墙壁的边缘上,很美

exquisite-little-girls3-32
给自己的钥匙配上一个漂亮的钥匙扣

exquisite-little-girls3-33
拍照时不要总是学非主流,嘟起嘴巴,睁大眼睛等,动作要有内涵,给人神秘感

exquisite-little-girls3-34
不要把轻微的放任变成犯jian

exquisite-little-girls3-35
买一套彩色笔,细一点的,在小本子上涂鸦,会很漂亮 画出你的心情. 很美腻的。偶尔心情不好可以涂一涂,看到彩色心情会变得好呢

exquisite-little-girls3-36
拥有一个有爱的闹钟,让你在清晨第一时刻有个好心情

exquisite-little-girls3-37
在家放一只假花,放在装有水的瓶子里 每天看到心情会放松很多,真花更好

exquisite-little-girls3-38
珍藏别人寄给你的礼物或信,千万不要转赠礼物

exquisite-little-girls3-39
买一副无镜片的眼睛,有时候也能带着好看好看

exquisite-little-girls3-40
找一块荒地,不要太偏僻的地方,到淘宝买50粒花种,种下吧,过几个月,属于你的满地的花田会绽开。拥有自己可以信任的独立小天地

exquisite-little-girls3-41
认真游戏,但牢记只是游戏

(1)尽量留长头发,这样才有气质,才有女孩所具有的风格。
exquisite-little-girls3-42

(2)穿得体的衣服,找有质量的男朋友,他不一定有钱,但是一定要让你有安全感和开心。
exquisite-little-girls3-43

(3)爱父母,每周至少打一次电话。
exquisite-little-girls3-44

(4)别逼男朋友撒谎,他会很恨你。
exquisite-little-girls3-45

(5)每天抱怨,唠叨,自恋,不超过10分钟。
exquisite-little-girls3-46

下面推荐几个好看的头发

exquisite-little-girls3-47
纯美长发

exquisite-little-girls3-48
浪漫系大卷发

exquisite-little-girls3-49
齐刘海+麦穗烫

exquisite-little-girls3-50
中分

减小腿:手机里面里下载一首全英文的比较有节奏感的歌,塞上耳塞,把音乐放到最大声,然后你最好双手撑在桌子上随着音乐的节奏小腿踮起来放下去,踮起来放下去,节奏从慢到快,几天你可以发现小腿紧实了。必要的话,其实手也可以一起甩起来,可以瘦手臂。

瘦大腿:我想说游泳真的很有效,还可以游出很好的身材,但是还有很多很有效的方法,比如跳绳,上下蹲每天一百下也是很有效的,
跑步个人不建议,很容易练成肌肉腿,如果是快走还行,因为大家都知道这是很健康的有氧操,快速高抬腿就是体育课那种,一天做几组,效果也是很明显的

瘦腰:很多人都知道的仰卧起坐确实很有效,但是好累,我难以坚持。
你可以一个人站直,试试把双手向上放直,然后双手合并,就是伸懒腰时的样子,然后站直,
双手用力握紧配合腰部来回转,简单做几下,放松甩甩手臂踢题腿,腰部效果明显,做几下就可以发现腰部紧实了

去痘痘:好像真的没有什么产品可以完全根除痘痘,要知道它是从因为身体内部油脂不平衡才会排到脸上的。
要内外结合才会彻底根除,但是也不排除一些青春期的痘痘,一过完青春期就会消失。
外用的产品我用过的安安比较有效果,安安粉刺露对痘痘和粉刺还是挺好的,当然这视个人皮肤来说。
我听说安安的青瓜洗面奶不错,没用过不确定,喜欢的朋友可以试试,要改善痘痘我觉得还是多吃水果多喝水好

长睫毛:这个我想大家都知道把,就是晚上睡前泡杯放茶叶的茶水,到明天早上凉的时候用化妆棉或棉签涂睫毛效果很明显。是个很简单又很有效的方式

去黑头:早上妈妈煮饭的时候你可以用一条很小的毛巾,敷在电饭锅出热气的地方,让毛巾吸收谁蒸汽。
这样毛巾会很烫,拿的时候要小心一点,很烫手,把刚拿出的热毛巾敷在鼻子上一两分钟。
敷鼻子也要小心点,很烫,刚敷上去那下可能会受不了,有红印,然后把毛巾拿掉。
此时受热的毛巾已经帮我们打开了毛孔。
用化妆棉沾好蛋清敷在鼻头,直到干时拿下,你会发现浮出的很多的脏东西

瘦臀:
站直,然后腰往地下弯,双手触地,然后手碰地拿起来碰地拿起来,手一般要到鞋子才算韧带正常。
一般人都会到的,只是会很难一直保持把手放在地下的姿势,但是这样拉韧带对长高还有提臀效果特别好。
可以慢慢来,先做几组,第一天可以只做十个,第二天就15个,第三天慢慢加,然后直到可以连着做100个。
逐渐就变成是练习把手背触地,而不是手指。
这样每天坚持一下,对韧带还有需要舞蹈的朋友都很好,最重要的是它可以很好的提臀

瘦肌肉型小腿:
得先把它变回油脂型的腿,就是那种摸去肉松松的感觉。
这时候就没事的时候多站起来踢踢腿,高抬腿每天多做几组,做完记得拍拍小腿,以免又变回肌肉腿。
当这样几天不放弃的做些腿部运动,肉肉会变松,但是千万别在这时间段吃很多油腻的东西

瘦手指:
只要不是骨架天生大难度就低点了,没事的时候多拉拉手,就是右手拉着自己左手的一个手指,轻轻往外拉。
它一般会有点响,有人说是疏通关节的,其实我也不懂。
还有就是用些瘦手霜,超市都有卖的。然后准备两个一次性手套,先用40多度的温水泡泡手,
然后泡的时候倒点盐洗手,在水里泡时可以拉手指,然后泡几分钟拿出来,涂上瘦手霜。
一次性手套戴住睡觉,第二天起来拿掉,这样坚持几天你会发现手指细了长了

瘦手臂:
睡前的时候可以和瘦腿一起做,大家都知道躺在床上双腿靠墙90度的姿势吧,在那同时我们的手怎么可以空着玩。
这样的时候可以拿着两瓶装满水的矿泉水,一起做运动,可以举着不动,也可以像举哑铃一样来回。
没事的时候,写完作业玩完电脑都记得常常甩甩手臂,按摩按摩

缩毛孔:
1.自制收毛孔剂:
菊花洁肤(每周一至两次)将菊花放在一杯热水中稍待片刻,然后去除花瓣留下花心,待凉了后再放进冰箱冷藏。
使用时以棉花或化妆棉沾湿,用以轻轻的洗脸,能彻底清洁残留在脸上的化妆品,使毛孔畅通,又能柔软肌肤

2.柠檬蜜+冰水紧肤(每周一至两次)。
洗脸后,用十滴新鲜柠檬汁,半杯蜜糖及三茶匙酵母粉混合后当面膜敷上。
酵母能将坏死细胞去除,蜜糖则能润滑皮肤,而柠檬更可吸收多余的油脂。
十分钟后再用冰水把面膜洗净,既能收紧毛孔,亦能促进血液循环,使肌肤回复光亮

去粉刺:小苏打粉法
工具:小苏打粉
具体做法:
1、小苏打粉少量,可以用我们平时喝酸奶的时候,随送的塑料小勺子,半勺就可,加纯净水或矿泉水,按照1:10的比例,用小勺搅拌,直到小苏打粉溶解。
2、取一片化妆棉泡在里面,轻轻拧一下水分,半干的状态下,贴在鼻子上,也可以贴在下巴,额头等油腻处,15分钟后拿下来,不要等到干透

美白:
1.牛奶美白:准备一小杯鲜奶,(夏天的时候,也可以把鲜奶到放到冰箱里,敷上凉凉的,会更舒服)。
用蒸气蒸脸,将化妆棉吸满鲜 牛奶美白奶,敷在脸上十五分钟左右,取下,用清水将脸上的牛奶洗净。
长期坚持,可以使肤色白净均匀

2.准备三指宽二指长的面带斑点的芦荟叶去刺洗干净,然后是一块三厘米长的黄瓜、四分之一鸡蛋清、2—3克珍珠粉、适量的面粉(用做调稀稠)。
将芦荟、黄瓜放入榨汁机榨汁后倒入小碗,然后放入蛋清、珍珠粉、适量面粉调成糊,以不往下流淌为准。
把脸洗干净,将调好的糊抹在脸上,干后洗净,拍上柔肤水、护肤品即可,每周1—2次

3.番茄蜂蜜美白:这个美白配方可同时作脸及手部美白。特别是暗疮皮肤,能有效去油腻,防止感染,使皮肤白皙细致。
配方:蕃茄半 蕃茄蜂蜜美白个、蜂蜜适量。
用法:可将蕃茄搅拌成蕃茄汁后加入适量蜂蜜搅至糊状。均匀涂于脸或手部,待约15分钟洗去。
建议每星期做1-2次

4.将青椒、大黄瓜、四分之一苦瓜、西洋芹、青苹果等打成美容蔬菜汁来喝。
这样的蔬菜汁里头有足够的维他命C,对于美白非常有效。

5.取新鲜鸡蛋一枚,洗净揩干,加入500毫升优质醋中浸泡一个月。
当蛋壳溶解于醋液中之后,取一小汤匙溶液掺入一杯开水,搅拌后服用,每天一杯。
长期服用醋蛋液,能使皮肤光滑细腻,扫除面部所有黑斑。

每天至少喝800ml水 喝适量的水是帮助脸部消除浮肿的有效方法之一。
如果你不喜欢每天喝下一杯又一杯平淡无味的清水,可以在水中加入少许柠檬片或柠檬汁。
如果用咖啡、茶、苏打水或水果汁来替代清水,其补水效果不能等同于800ml清水,还可能带来你计划之外的热量。

2.每天至少吃3个水果和3两蔬菜 瘦脸离不开全身减肥,因此控制摄取的总热量相当必要。
多吃水果和蔬菜不仅容易产生饱腹感,还能帮助你减少吃甜品的强烈欲望。

3.对酒精说“不” 无论是啤酒、鸡尾酒、白酒,还是其他形式的酒精饮料,都可能让你面部浮肿和皮肤松弛。
此外,酒精饮料的热量很高,仅一杯200ml左右的酒精饮料,热量便可达到100千卡。

4.增加钙的摄入量
一项研究显示,接受测试的女性每天从食物中摄取1200mg的钙,能帮助身体更快地消耗脂肪,使脸部纤瘦、身材苗条。

exquisite-little-girls3-51
瘦大腿:
坐于书桌或电脑前的时候,拿一张纸,夹于两腿膝盖中间,维持它不掉下即可,不过两腿要夹紧喔!
虽然听起来颇简单,不过实行起来可会酸酸的哩!这个动作会使用到平常不常用到的大腿内侧肌肉

exquisite-little-girls3-52
简单的20种美白脸部方法
1.要睡觉的时候,拿小黄瓜切雹放置脸上过几分钟拿下来,一个月您的脸就会变白嫩白

2.睡前用最便宜的化妆棉加上化妆水完全浸湿后,敷在脸上20分钟,每周3 次,您的皮肤会有想不到的水亮清透喔

3.每天起床喝2杯水,其中一杯加些盐巴,可以清肠胃

4.出门前一定要擦隔离霜及防晒乳,回到家记得要马上卸妆

5.先用温水再用冷水洗脸会让肌肤既干净且毛细孔会变小

7.每晚洗完脸后,将养乐多倒在化妆棉上,直接敷在两颊。
甚至连额头、下巴也可顺便敷上,不但去斑兼美白,因每次用量大约只有六分之一瓶的养乐多

8.晚上少喝水,白天多喝水,睡前敷水亮面膜;多吃水果,不喝酒不抽烟不熬夜,保证水亮

9.首先用冷茶包敷眼五分钟,接着做一个类似瑜珈的动作。
这个动作是先盘腿,再将手举高后往前趴下,保持这个姿势约十分钟。
这个动作一开始不容易做到十分钟,要一段时间的练习,但是效果真的很好

10.市售的纯水一瓶(600cc),只要一周用纯水洗脸3~4次,并经常以化妆绵沾纯水敷面,脸脸自然而然的漂漂喔

11.据医学报导,阳光中的紫外线,除了一般人所知的UVA及UVB外,还有所谓的UVC。
平常有阳光出现的日子,UVC及UVB易造成晒伤,但可别以为阴天就不需防晒了,因为阴天时仍有UVA长波射线会对肌肤造成伤害。
因此最好还是撑伞,才能防止老化的提早发生

12.使用意仁粉,加一小匙在大约1000cc的水中,当饮用水喝。
不单只对皮肤好,连对减肥都有神奇的幼议寣I这是利用意仁具有利尿的效果。
可以减少浮肿,所以具有瘦身及瘦脸的功效而且对美白肌肤也有很大的帮助

13.泡温泉,泡温泉不仅可让肌肤粉润光滑,且还可消除疲劳。
若有皮肤过敏者,泡有疗效的温泉还可改善哦

14.酵母粉1大匙(超市均有售)加统一优格1/2杯,
取适量涂抹于面膜纸上再贴于脸上5~10分钟即可,一周约2~3次美白效果会更好。
与SK-II面膜具有相同效果又省钱哦

15.小偏方:就是黑砂糖+蜂蜜+一点点水;虽然有点麻烦,但能让肌肤水嫩

用面粉蜂蜜及牛奶,以2:1:1的配方调匀,每周敷脸2次,每次15~20分钟。
用温水洗净,将化妆绵沾湿化妆水轻拍脸蛋,此项秘方需加配上一项独门绝招~
每天洗澡前先将脸蛋清洁干净,然后将蜂蜜涂抹脸上,让洗澡时的蒸汽,将珍贵的蜂蜜蒸入毛细孔

要拥有婴儿般的肌肤很简单:
A.饮食:拒绝任何辛辣,油炸食物。多吃蔬菜水果,多喝水。
B.睡眠:每天一定要11:00前上床睡觉。
C.运动每天早晚各运动一小时

只要觉得毛孔粗大时,可用以下几种不同的面膜来敷脸:
A.new skin的冰河泥加上敷面膏调匀后敷整晚睡觉效果超霹雳!
B.蛋白直接抹匀在脸上待干冲洗即可。
C.用市售干燥的敷面纸泡在牛奶里沥干后敷在脸上
D.绿豆粉加蛋白调匀后均匀涂在脸上

在吃的方面,好吃又不会发胖的几种选择如下:
A.薏仁洗净加水不加糖煮1~2个小时待凉当开水喝可消肿及美白。
B.枸杞加红枣加桂圆煮开不加糖待凉当开水喝可使脸色红润眼睛有神!
C.多喝用排骨炖的各种汤品

去粉刺好习惯:
1.避免头发遮盖面部,对粉刺猖獗的区域,最好不要刘海。发丝的遮盖会加重粉刺困扰

夏天西瓜挺常见的是吧,挤出少量的西瓜水,弄在手上,往脸上轻轻扑打,可以起到美白作用

推荐一款真正非常好用又实惠的面膜:雪完美。
国货,香港那边也很多人赞作为一般保养的话真的很好

雅芳的采唐韵洁面膏,对付大油田脸超灵。
洗完会很干,坚持用一段日子以后,脸就不怎么出油了。
而且好省,挤一厘米就可以了,一支可以用大半年。只对大油田有效,中、干皮的千万别用

采诗洗发水加澳宝护发素再加精华液,干发质的用过效果超好

手指沾牛奶在脸上打圈按摩,然后让牛奶在脸上自然风干,再用清水洗净即可.
手,脚,全身都可按此方法处理,长期坚持,确实肤白如玉.
角质层厚,皮肤不敏感的MM,还可以试用酸奶.反之不可.
干性皮肤,可考虑用全脂牛奶。油性皮肤,可考虑用脱脂牛奶

教你做一个精致的小女生 学生党请进(2)

exquisite-little-girls2-1
文静型
①多读书。
只有多看书才可以培养出那种感觉。谈吐才很文雅。
②少说话。
这个应该很明显了吧。如果你每分每秒都想说话,那么就算了吧。
③不要八卦。
这样会显得你很没有气质。很无聊。
④不要太张扬。
不要显露你有多么有钱多么漂亮。很肤浅。
⑤淡淡地笑。
不要笑得多么花枝乱颤,淡淡地笑就好了。
⑥服装。
不要太暴露。合体舒服就好。颜色最好比较淡。(白色,浅蓝一类的)
⑦成绩。
成绩最好要在前十。要写得一手好字。

exquisite-little-girls2-2
偏可爱。
想要成为这种类型的女孩请看。
①身高。
这种类型的女孩最好不要太高,可以有点肉肉,更可爱。
②配饰。
要有一些很可爱的配饰。比如说蝴蝶结什么的
③发型。
短发不错。(就像图片一样)长发弄个苞苞头,别个发夹~~齐刘海不用说了吧
④衣着。
可爱女生偏爱粉色和蓝色呀绿色一类的。衣服的话一件体恤。一条超短裙~~简单美腻。背带裤也是不二的选择。
⑤食物。
要让别人觉得你可爱从食物表现出来也不错哦。蛋糕啊。棒棒糖呀。冰欺凌。如果本来就喜欢就不用了。如果在减肥也不用了。。。= =
⑥笑容。
这个上面也说过。不过笑与笑不同。这个类型的女孩就可以笑得比较开朗。眨一下眼睛也很可爱哦~表情什么的比较夸张也不错。(不要过头就好。)
⑦阳光。
什么都要阳光。让人很温暖。可以多关心别人,别人会记住你的好,就会觉得你可爱咯~

exquisite-little-girls2-3
偏妖娆 (妖娆妖娆妖娆妖娆妖娆妖娆)
想要成为这种类型的女孩请看。
①最好长发
长发飘飘的感觉~很勾人吧。烫一点卷也不错。染得话就栗色。浅棕什么的。
②语言得当。
可以“调戏调戏”男生。但不要太过。这样会觉得你很有魅力。又不是冰美人。
③身高
好吧 这个类型最好比较高(矮子桑不起)
④身材
不用我说了吧。柳腰筷子腿什么的必须的、
⑤衣着
丝袜。必备。露脐装呀。超短得牛仔裤。。。
根据情况,对于气质就是很妖娆的女孩,衣服什么的都是浮云
⑥必要的
这个类型的女孩一般都比较漂亮。那么问题就出现了。要怎样才不会显得太风尘?首先。必要的矜持还是要的。(这个跟第②不矛盾哦,慢慢琢磨吧)
其次。不要太张扬。会招其他女生讨厌。(因为本来漂亮就会被嫉妒的)
最后。偶尔装装sha 如男生问你比较龌龊的问题时,装纯的机会就来了。

exquisite-little-girls2-4
时尚
想成为这种类型的女孩请看

①发型
可以个性 可以美腻
②衣着
这个自己会搭配就好了 多看看别人怎么搭配 然后自己学着配一些
T恤热裤什么的 碎花裙就不要了
③性格
可以桀骜不羁 只要不是书呆子就可以
④补充
如果哈韩可以考虑这个类型
⑤成绩(某人;怎么又是成绩 胭脂;没办法我是学生党)
有人认为很潮的人成绩都很差 其实不对 你成绩很好 衣着什么的不符合校规班规 老师
也拿你没办法 谁叫你成绩好.
⑥可以张扬
张扬一点对于这个类型的女孩也没什么不好 这个张扬也不是显摆 就是可以很开朗很外向 和其他女生谈谈最近的时尚趋势 还有最近什么新组合 也不错哦.不要让别人觉得你老掉牙(只对于这个类型 )

exquisite-little-girls2-5
冰美人
想成为这种类型的女孩请看
①面瘫
这个是必须的 不然怎么叫冰美人 这样如果偶尔你笑了其他人会被惊艳到.
②身材
最好也是比较高挑苗条 让人觉得你高高在上.
③成绩
必须好 没话说.
④不说话.
尽量不要说话.别人讨论什么的时候也不要插嘴.
⑤冰
冰美人自然要有冰的气质 实在迫不得已要回答别人的话时 多用;嗯 好 这样简单的
字来回答.要学会用眼神秒杀一切.作为冰美人难免会有关于你的流言蜚语 这时候.
眼神的作用就可以发挥的淋漓尽致了、
⑥补充
作为冰美人要用蔑视一切的心态 还有不要犯花痴 还要多读书 补充内涵.

其实这个类型的女孩有个好处.
就是可以不用搭理别人.
别人也知道你就那性格.

①善良.
比如很早很早以前那个用高跟鞋擦猫的仁兄.她再倾国倾城再一笑媚众生你会觉得她美么?
所以心地善良是很重要的.比如善待小猫小**如在灾难发生的时候不要一副幸灾乐祸的
样子 但是像什么虫子死了的 你不要说好可怜好可怜 这样别人会觉得你很装.从眼神中
流露出惋惜就可以了.
②自信.
不要一副自卑的样子.你比别人少了只眼睛还是别人比你多个耳朵?你要自信.自信会让你
变得美丽!一些小细节;走路时眼睛平视 碰见熟人微笑点头或打一下招呼.比如说话声
音清楚( 不是让你吼哈 )多微笑.这些都是你自信的表现.
③有主见 独立.
不要总是人云亦云.要有自己的观点和看法.当然不是要你总是跟别人反着来.
eg;一次讨论中.你发现你的观点和大部分人一样.这时候千万不要为了显出与众不同而与
真实想法悖论.你可以找出新的理由来证明你的观点.这样也会令人仰视.
④善解人意.
要学会理解别人多为别人想想.不要那么尖酸刻薄吧(实在找不出什么形容词了)
善解人意的女孩会很有气质 让人感觉像阳光一样很温暖
⑤有智慧 有涵养.
要有知识.不要一开口说话就让别人觉得你是一个肤浅的人.多读书多看有深刻含义的电影.还有粗口很忌讳.不要张口闭口就MDMD.即使是习惯也要努力改掉.如果十分生气可
以在心情骂.也可以用眼神表示

exquisite-little-girls2-6
疯丫头.

①要适度.
你大大咧咧可以.疯疯癫癫可以但是不要太过头了就好.偶然也可以静下来思考思考世界
和平人类灭亡之类的有深度的问题.
②开心.
要有一个开心的外表 让人觉得你很阳光可爱.当然你本来就天天笑得脸抽筋就跳过这条
③关心朋友.
即使在怎么不拘小节 在朋友伤心的时候还是有必要去安慰安慰的 稳固你们的友情.
④疯癫.
在合适的场合(不要太不合适就行)合适的时间(毕业考试后 分手了等等)与合适的人或
物(最好的死党)好好的疯癫一下.大吼?淋雨?随便你 发泄一下顺便让
人觉得你很率真.
⑤要会保密.
这样的女生人缘会很好 如果朋友告诉你什么秘密叫你千万不要说 你要守口如瓶 千万不
要对另一个女生说 即使说了千万不要告诉别人的话 你可以想象她也会这样告诉下一个人
总会传到告诉你秘密的人的耳朵里.会让人觉得你很不守信.信任是这样建立的呢.

exquisite-little-girls2-7
成熟.
想成为这种类型的女孩请看.

①风韵
风韵是属于成年人独有的形容词 举手投足都要显现你的魅力.不要像那种很清纯清纯得
不谙世事的女孩一样.
②衣着.
尽量不要穿很可爱的衣服 碎花裙 小西装比较适合.
③果断.
注意是果断不是武断.在一些事情上要学会判断.并且迅速作出决定 这也是成熟的表现.
④迷人的微笑
又是微笑 但不同的微笑绝对可以反映出不同的性格 成熟就要稳重 抿一下嘴巴 眼睛都
不用闭.可以对着镜子练练 会觉得别有风味.
⑤补充.
坐姿端庄优雅 谈吐大方 眼神毫不躲闪 走路平视前方 自信.典雅.

男生喜欢的女生.

(一)清新秀丽的外形
(二)高贵大方的举止

(三)甜美婉转的声音
(四)矜持娇羞的神态

(五)崇拜含情的眼神
(六)飘逸娟秀的字体

(七)洒脱出众的文采
(八)真情幸福的表白

(九)必备简单的厨艺
(十)适度刻意的距离

关于变美

多买一些水果房子家里.实在很饿的时候可以来拿吃 比零食什么的健康~

【祛斑】用茄子皮揉有斑的地方 揉一会儿再换一块 再用清水洗去~

【去死皮】把蛋清涂在皮肤上 等蛋白干后用温水洗去 死皮便脱去 使人容光焕发.

常吃樱桃.古代中医记载有助美容皮肤 多喝牛奶 少喝咖啡

发几个小运动.很有用

exquisite-little-girls2-sport1
瘦腿

exquisite-little-girls2-sport2
瘦大腿

exquisite-little-girls2-sport3
瘦肚子

exquisite-little-girls2-sport4
瘦肚子(注意不是完全放下 是放在离地10度左右的地方)

exquisite-little-girls2-sport5
瘦臀 (要做标准)

exquisite-little-girls2-sport6
瘦背(有些累)

exquisite-little-girls2-sport7
瘦腿瘦腰(舞蹈活动中的基本)

exquisite-little-girls2-sport8
瘦背(升级版)

exquisite-little-girls2-sport9
瘦腰(不解释 好累的 不过很管用)

exquisite-little-girls2-sport10
瘦腿(这个要多做几个才有用 推荐【35个】)

瘦身完毕;

保持身材小建议;

吃饭后不要马上坐着.如果实在想坐 去称一下体重 再决定也不迟.
多吃蔬菜等有营养的东西.快餐什么的 尽量少吃
抽空跳跳健身操.健康减肥.
多做运动 慢跑 游泳.
运动后记得按摩一下 防止长肌肉
睡前100次推腹按摩 减肚子
少食多餐.好莱坞女星的保持火辣身材的方法 每天5餐左右

如果你只吃一种食物瘦身
反弹率:95%
如果减肥餐单的唯一主角是黄瓜或西红柿 的确可以让你在瘦身一开始的阶段就看到不错的效果.但小编得提醒你 单一食物的复胖率是最高的.因为单一食物里通常只有一种或简单几种营养素 身体的新陈代谢会因为摄取不到合理完备的营养而逐渐退化 各项机能都可能逐渐变得不好.
如果你长时间使用这种方法瘦身 生理期都会受到影响 更可怕的是 由于身体的摄取功能已经紊乱 只吃了一点其他东西就极容易复胖.
Note
尽量摄取一些其他食物 像鱼类、菌类、青菜都是保持身材的好食物 记得只要不过多摄取油脂适量进食其他食物是不会胖的 当然 如果你瘦身成功后无所顾虑的吃喝 无论用了什么方法 反弹都是必然的 所以瘦身之后也一定要注意饮食的控制 少吃多动没有错

如果你瘦身时滴油不沾
反弹率;90%
在所有的营养成分里 油脂的卡路里的确是最高的 也是最容易让人发胖的 所以一直被当作减肥的大敌 但是油脂不能完全不摄取 否则皮肤和头发都会变得干燥 指甲也容易断裂 结果就算是体重轻了 也不会拥有白里透红的好气色.
Note
如果真的那么介意油脂 又希望瘦身有成效 就尽量不要选择动物性的油脂 可以改成不饱和脂肪酸的橄榄油 而食材内 例如鸡的外皮不要吃 五花肉改成精瘦肉等 这样一来 才能由内而外瘦得漂亮 瘦得健康

如果你只吃低卡食物
反弹率:70%
苗条身材的最大敌人就是高卡路里,所以一些低卡路里的食物,例如香菇、豆腐等就非常受欢迎。虽然这些食物对身体的确有益,但像单一食物瘦身法一样,身体会完全受不了这种严酷折磨。一旦身体摄取营养的平衡被打破,复胖将如影随形。而且有些饮料虽然已经强调是零卡路里,其中的糖分也不可忽视。
Note
保持身材的关键是控制糖的摄入量,而并非只能吃低卡食物。对于一些饮料、高糖的水果等食物尽量敬而远之吧,其他食物可以适量摄取。

如果你吃减肥药
反弹率:50%
减肥药对于很多懒得花时间和各种方法持续瘦身的你来说,是最省事的方法。而且吃减肥药的同时,还可以不用运动、不怎么节食……是不是想想都觉得激动?但小编要告诉你,这并不是值得提倡的方法。
一般来说,减肥药通常是利用抑制食欲和加速燃烧脂肪的方法来瘦身,一旦停药,脂肪代谢又变得缓慢起来,食欲慢慢恢复,复胖当然很容易。而且如果吃到不好的减肥药,不仅是瘦不下来这么简单,甚至健康都会被陪进去。
Note
增加运动量吧!并不是所有的运动都需要大汗淋漓,对于靠吃减肥药瘦身的你来说,适当做一些简单的运动就可以将完美身材保持下来,避免短期内瘦身引起的身体不适,也能调整身体的内循环,减缓停药后的反弹速度。如果一定要采用药物瘦身,尽量选择纯中药配方,记住,这个“纯中药配方”不是商家说的,而是中医根据你的身体状况配的

如果你采取激烈的运动
反弹率:30%
如果真的可以瘦,你是否愿意在健身房里运动到虚脱?相信八成的减肥者都愿意尝试这种事,但很可惜,剧烈运动瘦身之后也会反弹。做了激烈运动后,身体的疲劳感和无力感都非常强烈,而且通常在激烈的运动之后,为了能抚平疲劳感,饥肠辘辘的你会不自觉吃掉大量食物来补充体力。
同时,因为激烈运动做起来很辛苦,往往也持续不了多久,没毅力的瘦身当然会迅速复胖起来。
Note
选择有氧运动吧。运动瘦身的初衷并没有错,只是需要坚持二字。所以运动瘦身的人群想要保持身材就需要合理的食谱和适度的运动,这才是瘦身的黄金法则。适度的有氧运动,不仅可以帮助瘦身,更能雕塑身体曲线,让原来松垮垮的肉肉都重新变紧实。

下面是生活中的一些小常识~

早上吃些玉米可以防晒
减肥节食反弹机率极大
保鲜膜减肥不要轻易尝试
多睡觉即可减肥 又美容
坚持睡午觉延长寿命
女孩要爱美.学生党现在开始护肤不是损害皮肤 而是减缓衰老
如果还未满18岁.化妆什么的就不要了.这才是最损害皮肤的
喝牛奶过后 去接受阳光洗礼 帮助钙的吸收
方便面很可怕 不解释
少吃快餐 原因大家都懂得
偶尔放任一下自己 关掉闹钟 睡到自然醒
不要太过矫情 认为自己多悲情
不要在背后说别人的坏话
最美的不是最好的 最好的不是最适合你的.但最适合你的一定是最美的
你不爱你 谁爱你
即使减肥时爆过几次 也不要失去信心
别人讨厌你 你不必讨厌ta 因为ta还不配
不要为曾经写下的矫情文字而羞愧
每个人年轻时都会喜欢那么一两个人渣
心情不好的时候听听纯音乐

关于学生党的建议

不用刻意去讨老师欢心 最好用行动表示

短发是学生党不错的选择.梨花头的话不要染烫得太厉害

学生要清清爽爽.不要带项链什么的 耳环戒指也不要 可以周末带 美瞳也是

你会发现班上总有那么一些很jian的人.不用去理他们

写写日记。练练笔。最好能写优美一些还可以提高作文水平

不用太在意别人的看法,除非是真的超出了你能够忍受的范围

对于自己曾经喜欢过的人要学会释怀

偶尔也疯那么一下下,太沉闷别人看着也憋着慌

不要积存太多的秘密,偶尔对着天空什么的说出你的烦恼吧

多看些书,你会发现你不知道的事其实还有很多

我们总是关注我们得到的东西是否值钱,而往往忽略放弃的东西是否珍惜

偶尔回忆回忆过去,就会发现那么悲伤或快乐原来就真的只是过去了啊

嗯,还有建议大家去看看我们结婚了,一个很有趣的韩国节目~最爱维尼

不要为旧的悲伤,浪费新的眼泪

不喜欢喝开水的,喝茶也是一个很好的选择

用牛奶洗手能变白,用醋洗手能去角质

芦荟胶是个好东西,能去疤

一包瓜子的热量不比薯片那些少

白鞋子洗完要用纸张包了再放太阳下晒,不然会变黄

多吃胡萝卜头发能长的快 把头发绑起来 随意一点也能

教你做一个精致的小女生 学生党请进(1)

exquisite-little-girls-1
1.如果你有一个漂亮迷人的闺蜜,那么千万别带她去见你喜欢的男生,别以为朋友不会背叛你。往往两个女生闹翻都是因为男生。

exquisite-little-girls-2
2.对于你以为很讨厌你的老师,千万别恨他。因为你要知道,这个世界上除了你的父母,只有他们会对你真心实意。

exquisite-little-girls-3
3.别老吃什么阿尔卑斯费列罗,如果你不是在一个所谓贵族学校,它们只会带给他人一种距离感。相信我,换一根只要两块钱的糖葫芦,不一定要能一下吃完,拿在路上一路回家也会让人觉得亲近。

exquisite-little-girls-4
4.如果你能够做到和班上同学相处很好的话,那么可以在课间适当和他们开一些小玩笑,不要太过分,但是这样真的很容易让你拥有好人缘。

exquisite-little-girls-5
5.听不懂的东西可以下课问老师,这样一点也不丢脸。如果胆小可以叫上另一个同学一起。这样你在老师心里又会多几分印象分。以后家长会还能给家长争面子,期末什么学习标兵也非你莫属。

exquisite-little-girls-6
6.可以有很多有好感的男生,但是只能有一个是爱着的。太多感情付出只能让你分心,并且最后还没有结局。

exquisite-little-girls-7
7.选一种合手的笔芯型号,练出一种自己欣赏的字体,要让人看着顺眼。因为往往一种字体代表一种人的性格。这往往是很多女生不注重的小事,可是却是你让被人记住的致命特点

exquisite-little-girls-8
8.永远别去和在班上人缘极好的女生做闺蜜。不要问为什么,因为只有到你看到她和很多人要好从而冷落你的时候。你才会后悔。

exquisite-little-girls-9
9.适当在知名网站开一个帖子。不用人气特别高,但是这个可以填满没有男朋友的你空虚的课余时间。

exquisite-little-girls-10
10.不用太会画画,但是一定要有喜欢涂鸦的心态。这样又给你了几分才艺分。

exquisite-little-girls-11
11.别看了小说就以为特立独行高傲冷艳文艺的女主角很美就傻傻地去模仿。小说真的只是小说。在现实生活中这种人是没人敢喜欢的,而且这种寂寞的感觉虽然听起来好听,让很多女生崇拜。但是真正到了那个境界,自己其实是最痛苦的,这一点别人看不出。

exquisite-little-girls-12
12.练就一腔好口才最重要。只有在你说话的时候你才会意识到这有多重要

exquisite-little-girls-13
13.想要好口才光是买《让你拥有好口才的99招》、《看了这本书你才真正学会了说话》这一类光是标题就很有诱惑的书,因为你不可能随时带着一本书为你说话提供查阅,而你也不会2到把这些条条款款背下来。这种烂书我也有很多,但是往往要展现的时候一无是处。不如多交几个口才好的朋友,耳濡目染,渐渐地你会发现很有用。

exquisite-little-girls-14
14.别爱上身边有一个自称为“红颜知己”女生的男生,因为往往那个人才是他最后的归宿。

exquisite-little-girls-15
15.如果你还年轻,爱一个人千万别太用力。这样会让你再也爱不起,别以为这只是小说中的俗套情节,很多人就是因为年轻时受过情伤才沦为剩女。

exquisite-little-girls-16
16.当你分不清对一个人到底是喜欢还是爱的时候。就试一试离开他,等待有了另一个女生进入他的生活,在他们还没有你和他感情浓厚的时候问问自己的心:我在不在乎?如果你心里还是绞痛,那么回去,好好和他发展一段老了之后还能回想起来会怀念的恋情。

exquisite-little-girls-17
17.如果已经上课迟到,那么不要跑,走去教室。这样你的姿态会好看。
但是哦,要看你们的老师是什么样的人。

exquisite-little-girls-18
18.如果你所在的学校有很多人混势力,但是你又不想去涉足势力圈。那么可以交一两个这方面的朋友,但是你自己一定还要是一个好学生。这样可以保证没有一般的人敢动你,你又能品学兼优。

exquisite-little-girls-20
20.想让别人爱你要先爱自己。爱自己的第一步是十二点以前睡觉。

exquisite-little-girls-21
21.学会做菜,特别是甜品。最好能够拿到学校的那种,你也会很希望你喜欢的男孩子吃到朋友说赞的东西吧。

exquisite-little-girls-22
22.你觉得自己很美吗?如果你想从自己心里知道答案,那么请别那么勤快地照镜子,因为这样下去,你会发现那个女生很陌生。

exquisite-little-girls-23
23.别怕丑,从各种地方看来的小段子可以记下来,不必拿本子记,真正好玩的东西你自己都会印象深刻。这些东西你在任何场合说出来,大家都会愿意接近你。

exquisite-little-girls-24
24.别和丑男开玩笑。这些在旁人眼中就是暧昧。

exquisite-little-girls-25
25.少喝汽水,这个东西不但对身体不好,而且容易胖。DIY一些饮品,不仅喝的放心,而且能在人前展示你贤惠的一面。这样能让你又向完美走一步。

exquisite-little-girls-26
26.如果你自己不是那么贱的话,请不要交美术生做男朋友。因为这种专业的男生除了会用手画画以外,一无是处。我就是美术生,我很清楚,这种人最喜欢玩女生又最不负责任。

exquisite-little-girls-27
27.和闺蜜骂架的时候别太绝。虽然你当时恨不得永远不和她说话,但是如果你们之间不是杀父之仇或者夺夫之恨,我想到最后最后悔的还是你。

exquisite-little-girls-28
28.和所有男生处好关系,别是那种黏黏腻腻的关系,只要那种让谁都觉得你真的很好那种类型。因为谁也说不准,下一个你喜欢的男生就是谁最好的兄弟。到时候只要靠他多说好话就比你努力千百倍要强

exquisite-little-girls-29
29.看帖别跑堂,发帖别弃楼。前者是让发帖的人拥有一份好心情,后者是让看你帖子的人拥有一份好心情。有很多人追你的贴也是人气的象征,好心是会有好报的。

exquisite-little-girls-30
30.多穿校服,这样既能给老师留下朴素的好印象,又能让你多几分亲和力。

exquisite-little-girls-31
31.要想提高成绩,上课就一定要听讲。听讲不用每一条都记得清清楚楚,但是一定要能搞懂老师讲的是什么。试着给不会的同学讲解,这样比你闷着头去做试题来得好得多。

exquisite-little-girls-32
32.拥有一条围脖或是项链,这样很能给人你的注重细节。

exquisite-little-girls-33
33.睡前五分钟看一看单词,起床后五分钟也看一看。别小看这十分钟,这会让你背单词异常顺利。

exquisite-little-girls-34
34.你可以和所有人是好朋友。但是闺蜜只能有两个。三人游不是说说,这样的友情最坚固。

exquisite-little-girls-35
35.早上晚上背语文英语,这些只有背了才会成功,而这两个时间段记忆最好。中午两点到四点做理科试题,这个是题海战术最有效,而这个时间段你的头脑最清醒。

exquisite-little-girls-36
36.不一定要精通摄影,但是一定要学会拍照。这样你又能多一份对美的认识。

exquisite-little-girls-37
37.不一定要很会唱歌,但是一定要喜欢。这一环节是你人际中重要的一部分。这样很能让人对你刮目相看。

exquisite-little-girls-38
38.如果你很韩范儿,就要记住一个文具牌子:爱好。

exquisite-little-girls-39
39.分一些看娱乐八卦的时间关注时事吧。前者只会让你具有八婆气质,后者能让人觉得你有深刻内涵。

exquisite-little-girls-40
40.不一定要听汪苏泷和徐良这一类的歌手那些所谓靠“90民谣”上QQ音乐排行榜第一的歌,很多好歌往往是不知名的。不要怕难找,真正还是你自己听到好听的歌才叫做你喜欢的。

exquisite-little-girls-41
41.如果你足够有自信,自己照片作为头像会比那些模特让人看着舒服的多。

exquisite-little-girls-42
42.如果第二天要早起,请一定要在十点半前睡觉。我是说如果你不想坏事的话。

exquisite-little-girls-43
43.别轻易恨一个人——如果对方不会同时恨你的话。自己一个人恨着对方是很傻的行为。人家不痛不痒,最多就要遭受你的白眼,而你却要每天记挂着一个人并且做任何事情都诅咒TA。这样不是聪明人的选择。

exquisite-little-girls-44
44.如果是你爱吃的东西,别傻乎乎地认为好的东西要大家分享,所以别带到学校去。那种家里吃不了但是很受欢迎的东西可以拿到班上,既卖了人情又让人觉得你很大方。很多人吃你的东西也是人气的象征呢。

exquisite-little-girls-45
45.课间如果不是很饿,可以适当吃点坚果类的食品。这个和甜食最大的差距就是前者能解馋又没有什么大的危害,后者是长期下去胖死你。

exquisite-little-girls-46
46.如果你不想和你的朋友绝交,那么不到万不得已不能和她发生经济联系。不要问为什么,我只告诉你说有钱能使磨推鬼。

exquisite-little-girls-47
47.如果你不确定他是不是爱你,请放下你的伪装和你的容忍。用最真实的一面去面对他。真的爱你就会喜欢你的一切不是虚的。你可以容他一时,但不可能容他一世。

exquisite-little-girls-48
48.清火不是一定要吃药。一碗没有添加任何色素的白凉粉,加一点薄荷水和一勺白砂糖,就能抵过百味名贵草药。

exquisite-little-girls-49
49.你可以给他一种小女生的感觉。但是不能学台剧里的女主迷糊、白痴、爱管闲事。记住你不是程晓诗,也没有一个宁愿放弃美丽高贵的女配为你舍弃一切的何群。这样的女生只能让人觉得无限麻烦。而那个有心计遭到观众唾弃的完美女主角才会是最后的赢家。

exquisite-little-girls-50
50.要记住各科老师的姓氏,见到嘴甜一点叫一声鞠个躬不会少你一块肉。能换来的是很多年很多年那个老师还会记得你。

exquisite-little-girls-51
51.如果你在班上不是权威人士那么千万别去学诸葛前辈舌战群儒,因为往往少数服从多数。这样只会让人觉得你什么也不懂还要装。

exquisite-little-girls-52
52.你不是天天为了几毛钱差价去疯狂抢购各大超市晚上8:00过时蔬菜的中年妇女。所以请别在买泡椒凤爪的时候纠结哪一包凤爪多泡椒足的问题。想一想,一块凤爪一下就吃完了,而你大方的形象却会在大家心中毁一辈子。

exquisite-little-girls-53
53.在一些场合你总是能碰到校务工作人员,比如清洁工大妈或是门卫大爷什么的。离你很近的时候说一句:“辛苦了”,比起那些畏手畏脚嫌弃底层劳动者的人,别人心里也高兴,旁人看了也舒服。

exquisite-little-girls-54
54.有一种东西叫麦芽糖,很便宜,两块钱一大罐。它是半固体状态的糖,你可以把它固定在竹签上做成各种形状。如果各大节日不知道送朋友什么礼物。可以买这个,又便宜又有新意。

exquisite-little-girls-55
55.一感冒不是就要吃西药。中药虽然苦,但是却没有一个叫抗生素的东西危害你的生命。而且它永远都不会产生抗药性。

exquisite-little-girls-56
56.一定要装的不管用什么都要高质量干吗。换句话说你爸又不是国王,你干嘛要要求有公主的奢华。这种人在我们这种平民老百姓里面只能成为异类,没人会愿意伺候你这个大小姐,其他人又不是丫鬟。

exquisite-little-girls-57
57.用完别人的东西及时说谢谢,别嫌丢人啊,这样就能在别人心里留下礼貌的印象。

exquisite-little-girls-57-2
57.一定要和闺蜜买同一款的一样物件,这样是能使友情更加坚固的好办法。

exquisite-little-girls-58
58.即使你和TA关系再好,也不能和TA一起过夜。女生这种事情传出去会被指点没教养。

exquisite-little-girls-59
59.保存一些自己拍的很好的照片,随时拿出来欣赏的感觉是很不错的,而且别人也会觉得你多才多艺。

exquisite-little-girls-60
60.任何一次活动有条件都要记录影像,现在你可能没觉得有什么,但是等久了再看,就成了珍贵的收藏了。

exquisite-little-girls-61
61.和别人打字的时候不要说“哦”,这往往会使人失去继续聊下去的动力,觉得你没用心听她讲。

exquisite-little-girls-62
62.爱青春就读夏七夕,爱文艺就读独木舟,爱夏天就读微酸袅袅,爱童话就读桃子夏。

exquisite-little-girls-63
63.面对爱和你吵的**,你就要有毒舌的一面——你要比她更贱。

exquisite-little-girls-64
64.别在众人前哭,这样很丑。而且不能哭的尽兴,最好一个人的时候哭。这是最好的愈合方法。

exquisite-little-girls-65
65.别在所有人面前吃鸭爪鸭脖之类的东西,我是说如果你还要形象的话。

exquisite-little-girls-66
66.每个月计划用钱。别说大手大脚的你改不过来,一步一步来、。今天一天一百,明天七十,后天六十的方法是很有用的。

exquisite-little-girls-67
67.真正在乎你的人是不会发那种:不转发就死人的短信给你的。所以对自己在乎的人不能发。

exquisite-little-girls-68
68.真正想你那个得不到的他的时候,可以买一本小本子,写对他想说的话。别说这个很俗我不要,其实缓解思念很有用的。

exquisite-little-girls-69
69.碰到不想上的课的时候可以拿一张白纸,写一些心里想的有意思的东西,时间很快就过去了。

exquisite-little-girls-70
70.上课碰到好玩的事情又不好宣传的话就可以自编自画一副“八卦周刊”。表上时间日期,传给大家看,久了之后自己拿出来也很有纪念意义呢。

exquisite-little-girls-71
71.要看一个人是不是小气就直接把她背后的帽子从后面带上去,用力摁脑袋,但是别使太大的力。生气了最好就别和她交朋友,我打赌你三天以后就会说:我又不是她丫鬟,凭什么我要容忍她的处处计较。

exquisite-little-girls-72
72.别做那种明明考得很好却又嘴边挂着:“哎呀这回怎么又那么差的女生。”。这种人最贱了,大方承认,反而别人对你会多几分欣赏。

exquisite-little-girls-73
73.不是不能说人坏话,不可能说我明明看她不爽我还要忍着她。发泄不满情绪是人最基本的东西。但是对象一定要是可以信赖的人,传出去是很不好的。

exquisite-little-girls-74
74.回复别人不要是纯表情,超过三个字会让人觉得你很重视她。

exquisite-little-girls-75
75.在人气高的贴吧首页就不要一页一页去看了,只要一直F5,就会有不断地新帖子。

exquisite-little-girls-76
76.和他在一起很久,你还能努力经营这份感情付出的话,那么别因为感情平淡分手,到最后最痛苦的是你。

exquisite-little-girls-77
75.QQ签名可以有符号,可是别加一大串,还弄火星文。这种女生长产常常给人一种很幼稚的感觉。

exquisite-little-girls-76-2
76.一般那些你愿意用理论去同她争论的敌人,往往最后会成为你最好的知己。

exquisite-little-girls-77-2
77.想知道自己是不是变事故了。听一首陈奕迅,感同身受的话就一定是了。

exquisite-little-girls-78
78. 像《爱情买卖》、《伤不起》这种歌曲可以听过,但是千万别把它存在手机里,一般中年妇女都是这么做的。

exquisite-little-girls-79
79.课本不要买那么多花花绿绿的笔,这样在你看课本的时候是看不懂得。一支蓝的一支大红的,又好看又实用。

exquisite-little-girls-80
80.发帖最好时间:晚上九点半——十一点半。

exquisite-little-girls-81
81.有一个随身的包,别太小,会很有作用的。

exquisite-little-girls-82
82.有条件的话学会吉他。简单又文艺。

exquisite-little-girls-83
83.不是因为自己家穷就是会看不起自己,谁家不是白手起家的。虽然这个说法很傻。但是有志者事竟成。自己用功去做的,不会一直得不到。

exquisite-little-girls-84
84.支持新出的国漫,但是我说的不是少儿频道的垃圾动画片。新兴的国漫都很优质的,只不过是被一群脑残制作人毁掉了。

exquisite-little-girls-85
85.不是说你爱的男生他就一定爱你。这是青春期的通病,是一种生理现象,真的是不是爱你还要看其他的表现。

exquisite-little-girls-86
86.其实另类头像能让你更有个性。只有一个侧脸的头像常常让人视觉疲倦。

exquisite-little-girls-87
87.女生永远不要做让自己看不起的事情。这不是装酷,而是你该有的原哲。

exquisite-little-girls-88
88.多喝热水,当你的尿是清水状时,就说明你的身体足够健康了。

exquisite-little-girls-89
89.你的穿着永远不是他不看你的重要因素。人好,不需要任何附加条件,就能成功吸引其他人的目光。所以每个月二十多块钱一本的时尚杂志就可以省下了,欧美日韩都没有校服有活力。

exquisite-little-girls-90
90.如果你和你的闺蜜骂了架,千万别**要死地去问你们的共同朋友选你还是她,得到了答案,选了你固然是好的。但是另一个结果只会让你再失去一个朋友。与其活在残酷的现实中,给自己打造一些虚妄只是善待自己的一种方式。

exquisite-little-girls-91
91,做人别太张扬,这种人是班上被所有人讨厌的一种。低调才是王道。

exquisite-little-girls-92
92.走不了潮女风就可爱一点,这样做一点坏处也没有。

exquisite-little-girls-93
93.别以为拿个泡泡在你喜欢的人面前吹很梦幻,其实这个东西飘进眼睛里会失明的。

exquisite-little-girls-94
94.爱一个人不要强迫他和你用情侣网名。情侣头像。因为分了之后在朋友眼中是很丢脸的。

exquisite-little-girls-95
95.少吃曼妥思那种有糖衣的糖,吃多了舌头会被侵蚀掉,很容易口腔溃疡。

exquisite-little-girls-96
96.别把聊天的字体改到十八号,一坨一坨的粉红色真的很恶心。

exquisite-little-girls-97
97.如果在某群里和别人聊得很投机,算是尊重他人,请私聊。

exquisite-little-girls-98
98.固定长时间使用同一种沐浴露能够使你令人影响深刻。

exquisite-little-girls-99
99.有狐臭的话用明矾涂抹出汗处。夏天一天一次冬天一天一次,很管用的。

exquisite-little-girls-100
100.想要和一个人拉近距离最好的方法就是趁那个人病了的时候上去。别怕传染,这时候是人最脆弱和需要关心的时候。

来自http://tieba.baidu.com/p/1429574021

让WordPress使用Redis缓存来进行加速

Redis是一个高级的key-value存储系统,类似memcached,所有内容都存在内存中,因此每秒钟可以超过10万次GET操作。

我下面提出的解决方案是在Redis中缓存所有输出的HTML 内容而无需再让WordPress重复执行页面脚本。这里使用Redis代替Varnish设置简单,而且可能更快。

安装 Redis

如果你使用的是 Debian 或者衍生的操作系统可使用如下命令安装 Redis:

apt-get install redis-server

或者阅读 安装指南

使用 Predis 作为 Redis 的 PHP 客户端

你需要一个客户端开发包以便 PHP 可以连接到 Redis 服务上。

这里我们推荐 Predis. 上传 predis.php 到 WordPress 的根目录。

前端缓存的PHP脚本

步骤1:在WordPress 的根目录创建新文件 index-with-redis.php ,内容如下:

<?php

// Change these two variables:

$seconds_of_caching = 60*60*24*7; // 7 days.

$ip_of_this_website = ‘204.62.14.112’;

/*

– This file is written by Jim Westergren, copyright all rights reserved.
– See more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
– The code is free for everyone to use how they want but please mention my name and link to my article when writing about this.
– Change $ip_of_this_website to the IP of your website above.
– Add ?refresh=yes to the end of a URL to refresh it’s cache
– You can also enter the redis client via the command prompt with the command “redis-cli” and then remove all cache with the command “flushdb”.

*/

// Very necessary if you use Cloudfare:

if (isset($_SERVER[‘HTTP_CF_CONNECTING_IP’])) {
$_SERVER[‘REMOTE_ADDR’] = $_SERVER[‘HTTP_CF_CONNECTING_IP’];
}

// This is from WordPress:

define(‘WP_USE_THEMES’, true);

// Start the timer:

function getmicrotime($t) {
list($usec, $sec) = explode(” “,$t);
return ((float)$usec + (float)$sec);
}

$start = microtime();

// Initiate redis and the PHP client for redis:

include(“predis.php”);
$redis = new Predis\Client(”);

// few variables:

$current_page_url = “http://”.$_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’];

$current_page_url = str_replace(‘?refresh=yes’, ”, $current_page_url);

$redis_key = md5($current_page_url);

// This first case is either manual refresh cache by adding ?refresh=yes after the URL or somebody posting a comment

if (isset($_GET[‘refresh’]) || substr($_SERVER[‘REQUEST_URI’], -12) == ‘?refresh=yes’ || ($_SERVER[‘HTTP_REFERER’] == $current_page_url && $_SERVER[‘REQUEST_URI’] != ‘/’ && $_SERVER[‘REMOTE_ADDR’] != $ip_of_this_website)) {
require(‘./wp-blog-header.php’);
$redis->del($redis_key);

// Second case: cache exist in redis, let’s display it

} else if ($redis->exists($redis_key)) {

$html_of_current_page = $redis->get($redis_key);

echo $html_of_current_page;

echo “<!– This is cache –>”;

// third: a normal visitor without cache. And do not cache a preview page from the wp-admin:

} else if ($_SERVER[‘REMOTE_ADDR’] != $ip_of_this_website && strstr($current_page_url, ‘preview=true’) == false) {
require(‘./wp-blog-header.php’);
$html_of_current_page = file_get_contents($current_page_url);
$redis->setex($redis_key, $seconds_of_caching, $html_of_current_page);
echo “<!– Cache has been set –>”;

// last case: the normal WordPress. Should only be called with file_get_contents:

} else {
require(‘./wp-blog-header.php’);
}

// Let’s display some page generation time (note: CloudFlare may strip out comments):

$end = microtime();
$t2 = (getmicrotime($end) – getmicrotime($start));
if ($_SERVER[‘REMOTE_ADDR’] != $ip_of_this_website) {
echo “<!– Cache system by Jim Westergren. Page generated in “.round($t2,5).” seconds. –>”;
}
?>

或者直接下载 index-with-redis.php

步骤2:将上述代码中的 IP 地址替换成你网站的 IP 地址

步骤3:在.htaccess 中将所有出现 index.php 的地方改为 index-with-redis.php ,如果你使用的是 Nginx 则修改 nginx.conf 中的 index.php 为 index-with-redis.php(并重载 Nginx : killall -s HUP nginx)。

性能测试

1.没有Redis 的情况下,平均首页执行1.614 秒,文章页0.174 秒(无任何缓存插件)

2.使用Redis 的情况下,平均页面执行时间0.00256秒

我已经在我的博客中使用了如上的方法进行加速很长时间了,一切运行良好。

其他建议

我的环境是Nginx + PHP-FPM + APC + Cloudflare + Redis. 安装在一个 nano VPS 中,无缓存插件。

请确认使用了gzip压缩,可加快访问速度。

访问 wp-admin

要访问 wp-admin 必须使用 /wp-admin/index.php 代替原来的 /wp-admin/.

原文:jimwestergren 编译:oschina

哪7句话是安慰人时禁忌讲的?

我们社会如此惧怕死亡和悲伤真的不是你的错,因为从来没人教育我们,如何与悲痛中的人相处。以下呢,是七句你不该说的话,以及表达它们的更好方式。

1.别说“他去了一个更好的地方”或“你应该高兴,他不再受病痛折磨了。”
她想要他在的地方就是她的身边,无论他是否收到病痛折磨或者照顾他是多么困难。
更好的表达方式:“你一定非常想念他。”

2. 别说“你很快就能另得佳偶”或“你随时都能再生一个”或“至少你还有其他子女。”
但他这时满心悲痛、全心想寻回的那人却不在他身边,永远也无法以他人取代。尊重逝者吧。
更好地表达方式:“我知道她对你而言有多特别,也知道你爱她有多深。”

3. 别说“是时候让自己振作起来了。”
每个人悲痛的过程都是和别人不同的。也许这还不是她可以“振作起来”的时候。就算她目前还无法恢复正常,好好地照顾自己或家人,最好的解决办法也是让朋友或亲密的人暂时帮助照顾家里人一阵子,而不是使她感到羞愧,觉得自己“没能更好地处理这件事。”
更好地表达方式:“今天你一定过得不太好。我六点左右给你们带点晚餐过来如何?”

4. 别说“我敢肯定一切都会很快好起来的。”
糟糕!眼睁睁地看着朋友或家人受到悲痛折磨真是太难受了….我们往往想让他们感觉好点,这样我们自己才会感觉好点!记住,他也许正在想,自己永远不会开心起来了,因此你对他未来感受的主管臆断可能会让他非常烦闷。
更好地表达方式:“只要你需要我,我会一直在你身边。”

5. 别说“上帝总是有最好的安排。这一定是他的意愿。”
这可能会使悲痛者对上帝或其他神祗产生愤怒。另外,在提到上帝或任何其他神祗之前,了解对方的信仰系统也很重要。不要假定他和你有一样的信仰。
更好地表达方式:“我感到很难过。”

6. 别说“别在孩子面前哭。”
对孩子们来说,更让他们感到不安的是隐瞒真相,而不是开诚布公。因此,让孩子们感受到正常的悲痛并无不可。
更好地表达方式:“孩子们现在还好吗?”

7. 别:什么都不说。
事实上,这对悲痛中的人来说是最糟糕的情况了:人们对他的痛苦采取忽视态度。如果你不确定该说什么,或者不肯定对方是否愿意谈起此事,也可以就这样说:
更好地表达方式:“我不知道该说什么,但我想让你知道,我会一直陪着你。”和/或“你现在想谈谈她去世的经过吗?”
记住,和悲痛中的人在一起的时候,最重要的事情是:陪在她身边。有时候你甚至不需要讲话。她只需了解,你愿意在她伤心时陪她坐一会儿。

鱼-陈绮贞

陈绮贞-《鱼》

我坐在椅子上 看日出复活
我坐在夕阳里 看城市的衰弱
我摘下一片叶子 让它代替我
观察离开后的变化
曾经 狂奔 舞蹈 贪婪的说话
随着冷淡试戴浮华
带不走的 丢不掉的 让大雨侵蚀吧
让他推向我在边界奋不顾身挣扎
如果有一个怀抱勇敢不计代价
别让我飞 将我温柔环绕
我坐在椅子上 看日出复活
我坐在夕阳里 看城市的衰弱
我摘下一片叶子 让它代替我
观察离开后的变化
曾经 狂奔 舞蹈 贪婪的说话
随着冷淡试戴浮华
带不走的留不下的我全都交付他
让他捧着我在手掌 自由自在挥洒
如果有一个世界浑浊的不像话
原谅我飞 曾经眷恋太阳
带不走的丢不掉的让大雨侵蚀吧
让它推向我在边界奋不顾身挣扎
如果有一个世界浑浊的不像话
我会疯狂的爱上
带不走的留不下的我全都交付他
让他捧着我在手掌自由自在挥洒
如果有一个怀抱勇敢不计代价
别让我飞 将我环绕
原谅我飞 曾经眷恋太阳
原谅我飞 曾经眷恋太阳

20130202:一首好久没有听的歌,再次听起来真让人回味,好像是大学早期听到的,传给过几个朋友听过,后来有个女同学说是她传给我的,但我觉得是我传给她的。啊,我也不知道了,呵呵,缘分吧。想想那时候的很多朋友都没有联系了,不管是因为地理因素,还是感情因素,还是各种当时自己不成熟的表现,总之结果是基本不联系了。怅惋吗?也许这就是年轻的代价,这就是成长吧。能改变的,只有自己的心态心境,坦然面对,积极的生活。忽然发现歌词里有个词语“叶子”,还在思念吗?不可避免的。也许真的印证了歌词“我摘下一片叶子,让它代替我”。看看他们走过的路,终于知道自己的位置,时间空间,好像把自己的人生都看到了一样。不过这一切都要改变了,新的生活就要开始,未知的未来,我相信会有惊喜的。

经济科学参考书

一、入门教材:人大版《经济科学译丛系列》

   1、曼昆《经济学原理》上下册,88元。梁小民教授翻译。曼昆为哈佛高才生,天才横溢,属新古典凯恩斯主义学派,研究范围偏重宏观经济分析。

  该书为大学一年级学生而写,主要特点是行文简单、说理浅显、语言有趣。界面相当友好,引用大量的案例和报刊文摘,与生活极其贴近,诸如美联储为何存在,如何运作,Greenspan 如何降息以应付经济低迷等措施背后的经济学道理。该书几乎没有用到数学,而且自创归纳出“经济学10大原理”,为初学者解说,极其便利完全没有接触过经济学的人阅读。学此书,可了解经济学的基本思维,常用的基本原理,用于看待生活中的经济现象。可知经济学之功用及有趣,远超一般想象之外。推荐入门首选阅读。目前国内已经有某些教授依据此书编著《西方经济学》教材,在书中出现“经济学10大原理”一词,一眼便可看出是抄袭而来。

  2、 萨缪尔森《经济学》(Economics)

  萨缪尔森,新古典综合学派的代表人物,1970年成为第一个荣获诺贝尔经济学奖的美国人。研究范围横跨经济学、统计学和数学多个领域,对政治经济学、部门经济学和技术经济学有独到的见解。目前经济学各种教科书,所使用的分析框架及分析方法,多采用由他1947年的《微观经济分析》发展糅合凯恩斯主义和传统微观经济学而成的“新古典综合学派”理论框架。他一直热衷于把数学工具运用于静态均衡和动态过程的分析,以物理学和数学论证推理方式研究经济。目前经济学理论数学化大行其道,此翁实始作俑者。

  《经济学》由美国麦格劳——希尔图公司1948年初版。现已出第16版,通行全世界。国内50年代由高鸿业教授根据英文第10版翻译,商务印书馆于1981年出版。市面之16版,是和诺德豪斯合写,由萧深教授翻译。

  全书结构宏伟,篇幅巨大。可谓博大精深。渗透老萨数十年经济学见解。字里行间,三言两语,每有深意。其中诸如“热情的心,冷静的头脑”、“相关未必因果”等言语,可谓经济学之《老子》。读完该书,可了解经济学所探讨问题在经济学体系中之位置及分析框架,对经济学有一个完备之认识框架。知识庞杂,有一体系框架,则适宜以后更进一步学习。学之愈深,愈知此框架之重要。尽管该框架在宏观经济学的微观基础方面仍有断层,但不失为一个好框架。此书国内有机工版发行之英文版。建议直接阅读英文版。

  3、斯蒂格利茨《经济学》及系列辅助教材。斯蒂格利茨在信息经济学成就甚高,此书可作为前二者的补充,前二者所涉及经济学内容主要是以价格理论及边际分析为基础,不包括不对称信息经济学、不确定性分析部分。斯蒂格利茨之《经济学》可填充前二者之空白。

  尽管三位作者政策倾向不同,但教材体现凯恩斯主义的特征稍多一点,总体上讲,教材相当客观和公允。很适宜做入门教材。

  4、《经济学、原理、问题与政策》及《经济学原理与问题》、《经济学案例》、《经济学小品》、《经济学悖论》、《社会问题经济学》等。此类书之特点是先提问题,再论原理,主要是针对社会习见问题,逐步解释原理,水平、内容大多较好,唯缺乏体系与框架,适宜略懂经济学者补充学习。

  5、国内老师自行编写之《西方经济学》教材:目前国内各大学自己编写的直接冠以《西方经济学》或《经济学原理》均属入门教材。如高鸿业、历以宁、宋承先、梁小民、朱锡庆、尹伯成、司春林等等。然皆远逊外国教材。其中宋承先之《西方经济学》教材,竟用黑体加插一段马克思论地租之说法,以说明所传授学问之错误,实为极可笑者。

  说明:

   1、越基础性之教材越需深入浅出,将复杂抽象的道理联系到生活实际上,才讲的透彻,又能调起初学者之兴趣。国外教材,形成一竞争市场,多极高明之著作,教材之撰写也充分考虑学生学习之便利,如曼昆之教材,以完全不带数学式而著称,又或更新换版本极快,以及时吸收新知识,如斯蒂格利姿《经济学》之增加不对称信息部分。低手所写教材自然被市场淘汰。故市面之基础教材,多为大高手所写就。

   2、国内教材,建国以来,除商务系列丛书初期之100年前古典学派部分,政府同意翻译以作为马克思批判之反面教材得以出版外,80年代以前,近50年间国外经济学研究学问之成就,国人皆不得见。80年代末期,邹至庄先生力倡西方经济学,邓大人首肯之后,国内始渐有《西方经济学》之类教材出现。此类教材,多为新出道之老师,为进阶升职,凑出版物之数而编抄西人著作而成,机制所限,不敢添加“反动”之知识,又无竞争机制,购买者多为其听课学生。故质量甚差,若非特殊目的如考研指定者,慎勿购买。

   3、按经济学有入门低、中级、高级之分。高级乃指其运用之数学工具及阐述观点之纷争更多而言,并非此学问高人一等。一如高等数学未必高初等数学一等之意。越是高级,则越多分歧,也越追求数理逻辑之严谨,反不如低级来的实用。初级的入门教材一般是针对初学者,所以大多举案例和现象,加以文字解释,偶尔插加二维图案,高级教材注重数理逻辑,而二维图案及文字已难以表达、解决所说明之问题,故多用数学证明或代数方程,夹杂现代数学工具。中级教材则介乎其中,界定甚为模糊。教材难度不同,跨度也相差很大。

    

   二、中级微观教材

  中级教材一般以微观、宏观两科为主,兼修其他应用科目。传统经济学,本无宏观、微观之分,自凯恩斯针对名义变量进行宏观经济分析之后,始有宏观一科。故历来次序,先修微观,再修宏观,后及其他。

  微观经济学为各科之基础。其分析,乃基于马歇尔的一般均衡分析及边际效用学派之边际分析,而后由萨缪尔森发展数学方法及框架而成,涵盖范围甚广,大致包括:

  基础部分:传统厂商理论(技术、利润、成本)、传统消费者理论(效用、偏好、选择、需求)、局部均衡理论(完全竞争市场之稳定性)、一般均衡理论(福利经济学二大定理、交换方框图)

  分支部分:寡头市场理论(寡头、定价、市场细分)、博奕论(纯策略均衡、混合博奕、广延型结构、厂商博奕、颤抖的手)、公共物品理论(公共物品、税收制度设计、投票、外部效应)、不确定性经济学(风险、博采、保险、投资)、信息经济学(不对称信息、逆向选择、信号)、激励理论(委托-代理理论、契约理论)、法和经济学(制度经济学、企业性质分析、法律)、拍卖理论(拍卖机制设计)、匹配理论等。

  学习者可根据上述内容,与教材所列提纲比较,则可知教材侧重点之所在。

  6、《管理经济学》,有版本数种,特点各不相同。此类教材多为MBA系列教材。其目的针对生产过程决策而设,故与经济学之中级微观教材相较而言,减少少量分支部分理论,增加回归分析及计量统计部分。目前数种版本中,以人大版《工商管理经典译从》难度最低。机工版哈耶所写之《管理经济学—战略与决策》与标准中级教材难度大致相当,内容也接近。唯其中也已采用函数表达式。机工版莫瑞斯(有英文版及中文版,中文为陈章武所译)《管理经济学》难度最高,其侧重内容与中级教材大不相同,除回归分析已采用大量数据,要求建立模型,内容接近计量预测外,内容涉及对偶理论、不同代替效应之图解,附录采用微分法,难度较高。此类书籍,侧重经济学中与管理交叉管理。

  7、平狄克《微观经济学》人大版,此书乃标准中级微观经济学教材。在美国多个大学供MBA采用,国内英文版有清华版,中文版有人大版。此书内容适中,主题广泛,均是各部分理论之要点,不旁及其他分歧内容,其中定价部分较为详细。图形清晰,语言流畅。所采用数学工具甚浅,有函数但不涉及微分,只用差值。曲线只用标准严格凹性曲线,不及拟凹部分、线性仿射内容,成本函数也均为线性。建议此书应通读,可作进阶之用。

  8、曼斯非尔特《微观经济学》人大版,内容、难度、书价与平狄克相仿,唯编排次序不同。体系稍显庞杂,不如平狄克之明晰,然也为一国外通行教材。若修习平狄克有不明之处,则可先参照此教材或先修学其他国内出版之书籍。如北大系列教材之周惠中〈微观经济学〉,北大版朱善利之《微观经济学》等。此书不属必读。

  9、《国外经济学教材库》系列之《应用微观经济学》,32开,经济科学出版社。此书有大量案例及微观经济原理之运用,所用数学甚少,读此书,可补充平狄克教材之案例。加深对经济学之了解。

  10《微观经济学: 现代观点》(Intermediate microeconomics)[美] 范里安(Varian, Hal R.)著,费方域翻译。据美国W.W.诺顿图书公司 1990年版译出,三联版。此书是极规范之经济学专业的中级微观教材。美国MIT,哈佛、伯克利经济学本科指定教材。32开,800多页。易懂而深刻。本书为第二版,内容除论述了市场、消费者偏好、需求、技术、利润、生产等问题,还增加了两章, 分别论述了要素供给和信息经济等。内容上相当关注技术细节问题,比平狄克要更深一些。范里安微观经济学与数学造诣极深。然此书乃其为学生所写之中级教材,刻意避免数学之应用,大部分数学推导放于附录,微分运用相当少,适宜学完平狄克后重点阅读。可作平狄克中各部分理论内容之拓展。

  

 三、中级宏观教材

若无意进一步学习高级微观经济学,则可同时学习宏观经济学。微观的特点是精深,宏观则是驳杂。因为宏观流派很多,观点各不相同。

  11、《宏观经济学》曼昆,人大版。中文翻译。此书秉承曼昆《经济学原理》之优点,以简单,浅显为特点。虽只有很少量的数学,但对原理及内容均提炼得甚为简洁。前半部分写得相当清晰。可读完萨缪尔森《经济学》并略懂一点微观后直接学习。适宜一个循环学习,即以书入手,修完《全球视角》后,再回头重修此书,有提纲挈领之用。缺点是作者似乎限于门户之见,对真实周期学派、奥地利学派等其他学派提得很少。建议阅读。

  12、《宏观经济学》多恩布什。人大版中文翻译,东北财大有影印英文版。此书是标准的中级宏观教材,属正统教材。体系清楚,描述准确,通行于美国各大学多年。采用凯恩斯IS-LM体系为框架,对各个流派评价及描述相当公平。推荐必读。

  13、《宏观经济学》人大版,中文翻译。罗伯特霍尔,整本书显得有点凌乱,适宜读过其他中级宏观再做印证之用,内容比上述两本教材略深。不属必读范围。

  14、《宏观经济学》巴罗。清华,影印英文版。巴罗宏观经济学造诣很深,主要研究领域在经济增长理论。但写的书却销路很差。学这本书可作为对上述教材所属凯恩斯学派的一个补充。不属必读范围。

  15、《全球视角的宏观经济学》三联版 杰佛里萨克斯,32开,1000页。萨克斯成功处理了南美高通货膨胀的问题,但书一样写的相当好,整本书注意细节而有条理。很适宜读完多恩布什《宏观经济学》后进一步阅读。以拓展知识。上述5种教材所用符号各不相同,对学习者实在甚为不便。

  16、《国际经济学》 保罗克鲁格曼,今日之宏观经济学,已很难讨论封闭的宏观经济,此书可谓进一步拓展的宏观经济学,包括国际贸易和国际金融两个部分,渗透克鲁格曼的经济思想,所采用框架为AS-AD框架,可作IS-LM框架的补充。推荐阅读。

  17、《现代宏观经济学发展与反思》及《现代宏观经济学指南—各思想流派分析》及《与经济学大师对话》此系列三册,前两册为商务版。此书乃对各不同流派经济学大师的采访和评论,对各个流派的异同可以有清楚的了解,而且是直面经济学大师,可以看到各个大师之间彼此的观点不同,甚至成见立场,互相抨击之处,实在有趣。推荐阅读。

  

  四、其他教材:,

  18、人大版《经济科学译丛》系列之其他大多数教材:《经济思想史》、《财政学》、《公共部门经济学》、《人事经济学》、《金融学》(博迪)、《投资学》、《货币银行学》(米十金)等等实务应用之科目。适当补充阅读《公共选择理论》、奥地利学派、哈耶克、剑桥之争、非瓦尔拉斯均衡分析、等等内容。

  19、三联丛书黄皮书系列,其中显要者如《公共经济学》(Lectures on public economics)(阿特金森(Atkinson, Anthony B.) [美] 斯蒂格里茨(Stiglitz, Joseph E.)著)、《政治与市场: 世界的政治—经济制度》、《财产权利与制度变迁: 产权学派与新制度学派译文集》、《经济史中的结构与变迁》、《货币、银行与经济》(Money, Banking, and the Economy)〔美国〕托马斯.梅耶(Thomas Mayer)、《法和经济学》等等。可对经济学之应用领域获得一个深刻视角。三联丛书,推荐全部阅读。

  20、张五常《卖橘者言》、《佃农理论》、《经济解释》。张老先生近年是国内焦点所在,也写了几本〈随笔〉,发表不少演讲,大体而言,〈随笔〉不堪一读,其中论书法、摄影部分,不关主旨,且水平甚低,多属偏颇之见,今不论之。唯上述专著中之《佃农理论》,见解独到,尤有过人之处。建议修完中级微观后仔细阅读。《经济解释》则为论文集,然其中也有不少过激之言论及偏见,不可以教材视之。其中“合约理论”部分,可以一读。论“共产主义”部分,则未必有理。

  21、杨小凯《经济学原理》《新兴超边际古典经济学》,杨先生气魄甚大,欲以一己之力重写传统经济学体系,与汪丁丁先生有异曲同工之妙。可谓经济学之异端,读之可开阔视野。推荐阅读。

  22、《波斯纳文集》苏力翻译。老先生以法学专才,写《法之经济学分析》,实一极高明之人士,于此不可不提。推荐阅读。

  23、商务丛书《汉译世界名著》系列:此丛书系列,自二十世纪初商务王云五先生主持,与是事者不计其数,除文革中断十余年外,每年陆续出版,涵盖哲学(红皮)、历史(黄皮)、政治(绿皮)、经济(蓝皮)、语言学、人类学(未成),所翻译者,非经典不收,皆大师之精华,所主持翻译之人,多博学鸿儒或一代大师。单经济一门,翻译之著作,至今已近百种。百年间,传播知识无数,可谓功德无量。读完蓝皮经济类之全部,则可通晓经济学之来龙去脉。

    

  至此,无意于经济学一门谋生者,已然足够。然上述书籍,常人阅读,少者耗时约需1、2年以上。多者3、5年。且其中论著,多高明之作,或有一读再读之需,而读完,也或有“屠龙之技”之感也未之定,一笑!

    

  五、数学工具:即所谓数理经济学一科

  若数学水平较高,有意进一步玩弄经济学之数学智力游戏,则可参读以下数学工具:中国大学本科考研究生之数学三(高数、线性代数、概率论与数理统计)为必修之基础课,其他之数学工具则包括拓扑学初步(凸集、凹集、微分方程稳定性)、线性规划(代数理论、几何理论、对偶理论)、非线性规划(不等式约束规划)、变分法(欧拉方程、泛函函数、收敛问题、可变端点、横截条件、勒让得必要条件、相图分析)、最优控制理论(最大值原理、汉密尔顿函数)、连续时间优化规划、离散时间优化规划(不动点性质、值函数)、时间序列分析、非线性混沌系统、随机变量等等。

  24、《经济学中的数学》(入门水平)

  25、蒋中一《数理经济学基础》(基础水平)

  26、《动态优化基础》(进阶水平)

  27、高山成(takayama)《经济学中的优化方法》(推荐阅读)

  28、龚六堂《经济学中的优化方法》(推荐阅读)

  29、《经济学中的动态递归方法》(推荐阅读)

  30、《数理经济学手册》人大版(重点阅读)

  

六、中高级微观经济学

下文书籍,未必尽是高明著作,然国内此类教材甚少,下述书籍,聊胜于无。

  31、平新乔的《微观经济学18讲》,北大出版。内容属于中高级微观经济学,涉及微观领域较多,引入大量的数学运算,除文字内容外,强调逻辑推理。惟书中有不少印刷错误,且理论内容跳跃太快,不利学习理解,数学运用庞杂,不够明快清晰。在国内中高级教材中属中上之作,接近国外大学本科高年级水平。最大的优点是书后付有大量需要运算的习题,均需花时间读书和思考才能解决,很适宜学习训练。对从中级到高级过渡有帮助。不属必读范围。(CCER考博要用)

  32、张定胜《高级微观经济学》。武大出版。此书属于中高级内容,因涉及主题较少,故比平新乔之《18讲》显得清晰。适宜找不到其他中高级教材,而高级教材又甚困难,可以此书做过渡。

  33、 Nicholson 《 Microeconomic Theory》国内中文翻译出版。此书微积分运用、数学运算简洁明晰,全书难度、体系一致,排版清楚、内容重点突出,主题有深度,实为一极佳之中高级教材。书后之参考书目适宜进一步学习参考,为中级教材之中,最适宜和高级教材接轨者,唯书价稍贵,习题难度不深,习题量稍显不足。此书似乎出版发行量不多,除北大、复旦等处书店有少量可见外,其他大学及城市似甚少见。推荐阅读。

  34、蒋殿春《高级微观经济学》,经济管理出版社。此书主题基础部分已达高级水平,难度甚大。至博奕论以后部分,则难度甚浅。或与日本经济学之教授方法有关。对传统的价格理论的数学描述相当清楚。数学证明部分清楚。推荐阅读。

  35、张维迎《高级微观经济学》,此书张教授5、6年前在香港做访问学者时已准备出版,张五常之论著中,多处注释引自此教材,多种丛书翘首以待,均将此书名印于丛书之中,以待出版。然数年一去悠悠,至今未见面世。张教授微观造诣甚深,想来此书必也不错。估列于此处,他日或可望出版,若有见张教授者,也可代问此书出版之日。呵呵。(说实话,按照国际的标准,张维迎还很嫩很嫩,其理论方面的贡献几乎没有,数学也不行,我对此书不报任何希望)

  36、范里安《高级微观经济学》经济管理出版社。这是范里安在《微观经济学—现代观点》的基础上的标准高级教材。每一章均相当简短但精要。阅读时需要对中级教材有比较深入的学习。但翻译质量不佳。建议直接读英文版。接近研究生一年级水平。推荐阅读。(中译本确有不少错误)

  37、武康平《高级微观经济学》,清华版。进一步学习数理经济学之用。不属于必读范围。

  38、《微观经济学》《microeconomics theory》andrew.mas-colell Green等,社科院,中文版,北大翻译。110元。经典中的经典目前所见,顶级教材,研究生一年级水平。推荐阅读。(国外博士生一年级广泛使用此书)

    

  七、高级宏观经济学

  39、 《高级宏观经济学》 戴维 罗默。商务版。推荐阅读(国内名校考博开始使用此书)

  40、 布兰查德《高级宏观经济学》

  41、 萨金特《动态宏观经济理论》

  42、 龚六堂《高级宏观经济学》、《经济增长理论》。推荐阅读

    

  八、其他教材

  43、《计量经济学》、《数理经济学》、《数量经济学》、《经济增长理论》、《金融经济学》《产业组织理论》、(泰勒尔)。属于研究生初级教材。

  44、中国社会科学文献出版社《哈佛剑桥经济学著作译丛》:《经济理论的进展》(上下)、《公共选择理论》、《治理机制》、《不确定性与信息分析》、《经济学中的制度》推荐全部阅读。

  45、社会科学出版社《国外经济学名著丛书》系列:《企业经济学》、《农业发展的国际分析》(速水右次郎)、《同意的计算》(布坎南)、《货币数量论研究》(佛里德曼)推荐全部阅读。

  46、经济科学出版社《国外经济学教材库》系列:此系列水平介于本科与研究生之间,若学完上述其他教材,此系列可不必阅读。聊记于此。

  47、邹恒甫主编:《金融丛书系列》:以让拉丰《激励理论》为最高水平,其他尚可。

  48、中国社会科学出版社《当代经济学教科书译丛》系列:目前国内所见最好教材系列,学完这个系列,建议找老师报考研究生进一步学习。

  

  还有Greene的《计量经济分析》,Hamilton的《时间序列分析》,Campbell等的《金融市场计量经济学》,Chew的《公司治理的革命》都是高级课程的精品。
本文来自: 人大经济论坛 详细出处参考:http://www.pinggu.org/bbs/viewthread.php?tid=314955&page=1

看不懂的vm备份脚本

转自http://communities.vmware.com/docs/DOC-8760

 

ghettoVCB.sh – Free alternative for backing up VM’s for ESX(i) 3.5, 4.x & 5.x

版本 81  单击查看文档历史记录
创建于: 2008-11-17 下午7:04 作者 lamw – 最后修改:  2013-1-26 下午3:58 作者 lamw

Table of Contents:

    • Description
    • Features
    • Requirements
    • Setup
    • Configurations
    • Usage
    • Sample Execution
      • Dry run Mode
      • Debug backup Mode
      • Backup VMs stored in a list
      • Backup All VMs residing on specific ESX(i) host
      • Backup All VMs residing on specific ESX(i) host and exclude the VMs in the exclusion list
      • Backup VMs using individual backup policies
    • Enable compression for backups
    • Email Backup Logs
    • Restore backups (ghettoVCB-restore.sh)
    • Cronjob FAQ
    • Stopping ghettoVCB Process
    • FAQ
    • Our NFS Server Configuration
    • Useful Links
    • Change Log

 

Description:

This script performs backups of virtual machines residing on ESX(i) 3.5/4.x/5.x servers using methodology similar toVMware’s VCB tool. The script takes snapshots of live running virtual machines, backs up the  master VMDK(s) and then upon completion, deletes the snapshot until the next backup. The only caveat is that it utilizes resources available to the Service Console of the ESX server or Busybox Console (Tech Support Mode) of the ESXi server  running the backups as opposed to following the traditional method of offloading virtual machine backups through a VCB proxy.

This script has been tested on ESX 3.5/4.x/5.x and ESXi 3.5/4.x/5.x and supports the following backup mediums: LOCAL STORAGESAN and NFS. The script is non-interactive and can be setup to run via cron. Currently, this script accepts a text file that lists the display names of virtual machine(s) that are to be backed up. Additionally, one can specify a folder containing configuration files on a per VM basis for  granular control over backup policies.

Additionally, for ESX(i) environments that don’t have persistent NFS datastores designated for backups, the script offers the ability to automatically connect the ESX(i) server to a NFS exported folder and then upon backup completion, disconnect it from the ESX(i) server. The connection is established by creating an NFS datastore link which enables monolithic (or thick) VMDK backups as opposed to using the usual  *nix mount command which necessitates breaking VMDK files into the 2gbsparse format for backup. Enabling this mode is self-explanatory and will evidently be so when editing the script (Note: VM_BACKUP_VOLUME variable is ignored if ENABLE_NON_PERSISTENT_NFS=1 ).

In its current configuration, the script will allow up to 3 unique backups of the Virtual Machine before it will overwrite the previous backups; this however, can be modified to fit procedures if need be. Please be diligent in running the script in a test or staging environment before using it on production live Virtual Machines; this script functions well within our environment but there is a chance that  it may not fit well into other environments.

 

If you have any questions, you may post in the dedicated ghettoVCB VMTN community group.

 

If you have found this script to be useful and would like to contribute back, please click here to donate.

 

Please read ALL documentation + FAQ’s before posting a question about an issue or problem. Thank You

Features

  • Online back up of VM(s)
  • Support for multiple VMDK disk(s) backup per VM
  • Only valid VMDK(s) presented to the VM will be backed up
  • Ability to shutdown guestOS and initiate backup process and power on VM afterwards with the option of hard power timeout
  • Allow spaces in VM(s) backup list (not recommended and not a best practice)
  • Ensure that snapshot removal process completes prior to to continuing onto the next VM backup
  • VM(s) that intially contain snapshots will not be backed up and will be ignored
  • Ability to specify the number of backup rotations for VM
  • Output back up VMDK(s) in either ZEROEDTHICK (default behavior) or 2GB SPARSE or THIN or EAGERZEROEDTHICKformat
  • Support for both SCSI and IDE disks
  • Non-persistent NFS backup
  • Fully support VMDK(s) stored across multiple datastores
  • Ability to compress backups (Experimental Support – Please refer to FAQ #25)
  • Ability to configure individual VM backup policies
  • Ability to include/exclude specific VMDK(s) per VM (requires individual VM backup policy setup)
  • Ability to configure logging output to file
  • Independent disk awareness (will ignore VMDK)
  • New timeout variables for shutdown and snapshot creations
  • Ability to configure snapshots with both memory and/or quiesce options
  • Ability to configure disk adapter format
  • Additional debugging information including dry run execution
  • Support for VMs with both virtual/physical RDM (pRDM will be ignored and not backed up)
  • Support for global ghettoVCB configuration file
  • Support for VM exclusion list
  • Ability to backup all VMs residing on a specific host w/o specifying VM list
  • Implemented simple locking mechenism to ensure only 1 instance of ghettoVCB is running per host
  • Updated backup directory structure – rsync friendly
  • Additional logging and final status output
  • Logging of ghettoVCB PID (proces id)
  • Email backup logs (Experimental Suppport)
  • Rsync “Link” Support (Experimental Suppport)
  • Enhanced “dryrun” details including configuration and/or VMDK(s) issues
  • New storage debugging details pre/post backup
  • Quick email status summary
  • Updated ghettoVCB documentation
  • ghettoVCB available via github
  • Support for ESXi 5.1 NEW!
  • Support for individual VM backup via command-line NEW!
  • Support VM(s) with existing snapshots NEW!
  • Support mulitple running instances of ghettoVCB NEW!
    (Experimental Suppport)
  • Configure VM shutdown/startup order NEW!
  • Support changing custom VM name during restore NEW!

 


 

Requirements:

  • VMs running on ESX(i) 3.5/4.x+/5.x
  • SSH console access to ESX(i) host

 


 

Setup:

1) Download ghettoVCB from github by clicking on the ZIP button at the top and upload to either your ESX or ESXi system (use scp or WinSCP to transfer the file)

2) Extract the contents of the zip file (filename will vary):

# unzip ghettoVCB-master.zip

Archive:  ghettoVCB-master.zip
   creating: ghettoVCB-master/
  inflating: ghettoVCB-master/README
  inflating: ghettoVCB-master/ghettoVCB-restore.sh
  inflating: ghettoVCB-master/ghettoVCB-restore_vm_restore_configuration_template
  inflating: ghettoVCB-master/ghettoVCB-vm_backup_configuration_template
  inflating: ghettoVCB-master/ghettoVCB.conf
  inflating: ghettoVCB-master/ghettoVCB.sh

3) The script is now ready to be used and is located in a directory named ghettoVCB-master

# ls -l

-rw-r--r--    1 root     root           281 Jan  6 03:58 README
-rw-r--r--    1 root     root         16024 Jan  6 03:58 ghettoVCB-restore.sh
-rw-r--r--    1 root     root           309 Jan  6 03:58 ghettoVCB-restore_vm_restore_configuration_template
-rw-r--r--    1 root     root           356 Jan  6 03:58 ghettoVCB-vm_backup_configuration_template
-rw-r--r--    1 root     root           631 Jan  6 03:58 ghettoVCB.conf
-rw-r--r--    1 root     root         49375 Jan  6 03:58 ghettoVCB.sh

4) Before using the scripts, you will need to enable the execute permission  on both ghettoVCB.sh and ghettoVCB-restore.sh by running the following:

chmod +x ghettoVCB.shchmod +x ghettoVCB-restore.sh

 


 

Configurations:

The following variables need to be defined within the script or in VM backup policy prior to execution.

Defining the backup datastore and folder in which the backups are stored (if folder does not exist, it will automatically be created):

VM_BACKUP_VOLUME=/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS

Defining the backup disk format (zeroedthick, eagerzeroedthick, thin, and 2gbsparse are available):

DISK_BACKUP_FORMAT=thin

Note: If you are using the 2gbsparse on an ESXi 5.1 host, backups may fail. Please download the latest version of the ghettoVCB script which automatically resolves this or take a look at this article for the details.

Defining the backup rotation per VM:

VM_BACKUP_ROTATION_COUNT=3

Defining whether the VM is powered down or not prior to backup (1 = enable, 0 = disable):

Note: VM(s) that are powered off will not require snapshoting

POWER_VM_DOWN_BEFORE_BACKUP=0

Defining whether the VM can be hard powered off when  “POWER_VM_DOWN_BEFORE_BACKUP” is enabled and VM does not have VMware  Tools installed

ENABLE_HARD_POWER_OFF=0

If “ENABLE_HARD_POWER_OFF” is enabled, then this defines the number  of (60sec) iterations the script will before executing a hard power off  when:

ITER_TO_WAIT_SHUTDOWN=3

The number (60sec) iterations the script will wait when powering off  the VM and will give up and ignore the particular VM for backup:

POWER_DOWN_TIMEOUT=5

The number (60sec) iterations the script will wait when taking a  snapshot of a VM and will give up and ignore the particular VM for  backup:

Note: Default value should suffice

SNAPSHOT_TIMEOUT=15

Defining whether or not to enable compression (1 = enable, 0 = disable):

ENABLE_COMPRESSION=0

NOTE: With ESXi 3.x/4.x/5.x, there is a limitation of the maximum size of a VM for compression within the unsupported Busybox Console which should not affect backups running classic ESX 3.x,4.x or 5.x. On ESXi 3.x the largest supported VM is 4GB for compression and on ESXi 4.x the largest  supported VM is 8GB. If you try to compress a larger VM, you may run into issues when trying to extract upon a restore. PLEASE TEST THE RESTORE PROCESS BEFORE MOVING TO PRODUCTION SYSTEMS!

Defining the adapter type for backed up VMDK (DEPERCATED – NO LONGER NEEDED):

ADAPTER_FORMAT=buslogic

Defining whether virtual machine memory is snapped and if quiescing is enabled (1 = enable, 0 = disable):

Note: By default both are disabled

VM_SNAPSHOT_MEMORY=0
VM_SNAPSHOT_QUIESCE=0

NOTE: VM_SNAPSHOT_MEMORY is only used to ensure when the snapshot is taken, it’s memory contents  are also captured. This is only relevant to the actual snapshot and it’s  not used in any shape/way/form in regards to the backup. All backups  taken whether your VM is running or offline will result in an offline VM  backup when you restore. This was originally added for debugging  purposes and in generally should be left disabled

Defining VMDK(s) to backup from a particular VM either a list of vmdks or “all”

VMDK_FILES_TO_BACKUP="myvmdk.vmdk"

 

Defining whether or not VM(s) with existing snapshots can be backed up. This flag means it will CONSOLIDATE ALL EXISTING SNAPSHOTS for a VM prior to starting the backup (1 = yes, 0 = no):

ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=0

 

Defining the order of which VM(s) should be shutdown first, especially if there is a dependency between multiple VM(s). This should be a comma seperate list of VM(s)

VM_SHUTDOWN_ORDER=vm1,vm2,vm3

 

Defining the order of VM(s) that should be started up first after backups have completed, especially if there is a dependency between multiple VM(s). This should be a comma seperate list of VM(s)

VM_STARTUP_ORDER=vm3,vm2,vm1

 

 

Defining NON-PERSISTENT NFS Backup Volume (1 = yes, 0 = no):

ENABLE_NON_PERSISTENT_NFS=0

NOTE: This is meant for environments that do not want a persisted connection to their NFS backup volume and allows the NFS volume to only be mounted during backups. The script expects the following 5 variables to be defined if this is to be used: UNMOUNT_NFS, NFS_SERVER, NFS_MOUNT, NFS_LOCAL_NAME and NFS_VM_BACKUP_DIR

 

Defining whether or not to unmount the NFS backup volume (1 = yes, 0 = no):

UNMOUNT_NFS=0

Defining the NFS server address (IP/hostname):

NFS_SERVER=172.51.0.192

Defining the NFS export path:

NFS_MOUNT=/upload

Defining the NFS datastore name:

NFS_LOCAL_NAME=backup

Defining the NFS backup directory for VMs:

NFS_VM_BACKUP_DIR=mybackups

 

NOTE: Only supported if you are running vSphere 4.1 and this feature is experimental. If you are having issues with sending mail, please take a look at Email Backup Log section

Defining whether or not to email backup logs (1 = yes, 0 = no):

EMAIL_LOG=1

Defining whether or not to email message will be deleted off the host  whether it is successful in sending, this is used for debugging  purposes. (1 = yes, 0 = no):

EMAIL_DEBUG=1

Defining email server:

EMAIL_SERVER=auroa.primp-industries.com

Defining email server port:

EMAIL_SERVER_PORT=25

 

Defining email delay interval (useful if you have slow SMTP server and would like to include a delay in netcat using -i param, default is 1second):

EMAIL_DELAY_INTERVAL=1

Defining recipient of the email:

EMAIL_TO=auroa@primp-industries.com

Defining from user which may require specific domain entry depending on email server configurations:

EMAIL_FROM=root@ghettoVCB

 

Defining to support RSYNC symbolic link creation (1 = yes, 0 = no):

RSYNC_LINK=0

 

Note: This  enables an automatic creation of a generic symbolic link (both a  relative & absolution path) in which users can refer to run  replication backups using rsync from a remote host. This does not  actually support rsync backups with ghettoVCB. Please take a look at the  Rsync Section of the documentation for more details.

 

  • A sample global ghettoVCB configuration file is included with the download called ghettoVCB.conf.  It contains the same variables as defined from above and allows a user  to customize and define multiple global configurations based on a user’s  environment.

 

# cat ghettoVCB.conf 
VM_BACKUP_VOLUME=/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
DISK_BACKUP_FORMAT=thin
VM_BACKUP_ROTATION_COUNT=3
POWER_VM_DOWN_BEFORE_BACKUP=0
ENABLE_HARD_POWER_OFF=0
ITER_TO_WAIT_SHUTDOWN=3
POWER_DOWN_TIMEOUT=5
ENABLE_COMPRESSION=0
VM_SNAPSHOT_MEMORY=0
VM_SNAPSHOT_QUIESCE=0
ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=0
ENABLE_NON_PERSISTENT_NFS=0
UNMOUNT_NFS=0
NFS_SERVER=172.30.0.195
NFS_MOUNT=/nfsshare
NFS_LOCAL_NAME=nfs_storage_backup
NFS_VM_BACKUP_DIR=mybackups
SNAPSHOT_TIMEOUT=15
EMAIL_LOG=0
EMAIL_SERVER=auroa.primp-industries.com
EMAIL_SERVER_PORT=25
EMAIL_DELAY_INTERVAL=1
EMAIL_TO=auroa@primp-industries.com
EMAIL_FROM=root@ghettoVCB
WORKDIR_DEBUG=0
VM_SHUTDOWN_ORDER=
VM_STARTUP_ORDER=

To override any existing configurations within the ghettoVCB.sh script  and to use a global configuration file, user just needs to specify the  new flag -g and path to global configuration file (For an example,  please refer to the sample execution section of the documenation)

 

Running multiple instances of ghettoVCB is now supported with the latest release by specifying the working directory (-w) flag.

By default, the working directory of the ghettoVCB instance is /tmp/ghettoVCB.work and you can run another instance by providing an alternate working directory. You should try to minimize the number of ghettoVCB instances running on your ESXi host as it does consume some amount of resources when running in the ESXi Shell. This is considered an experimental feature, so please test in a development environment to ensure everything is working prior to moving to production system.

 

Ensure that you do not edit past this section:

########################## DO NOT MODIFY PAST THIS LINE ##########################

 


 

Usage:

# ./ghettoVCB.sh 
###############################################################################
#
# ghettoVCB for ESX/ESXi 3.5, 4.x+ and 5.x
# Author: William Lam
# http://www.virtuallyghetto.com/
# Documentation: http://communities.vmware.com/docs/DOC-8760
# Created: 11/17/2008
# Last modified: 2012_12_17 Version 0
#
###############################################################################

Usage: ghettoVCB.sh [options]

OPTIONS:
   -a     Backup all VMs on host
   -f     List of VMs to backup
   -m     Name of VM to backup (overrides -f)
   -c     VM configuration directory for VM backups
   -g     Path to global ghettoVCB configuration file
   -l     File to output logging
   -w     ghettoVCB work directory (default: )
   -d     Debug level [info|debug|dryrun] (default: info)

(e.g.)

Backup VMs stored in a list
    ./ghettoVCB.sh -f vms_to_backup

Backup a single VM
    ./ghettoVCB.sh -m vm_to_backup

Backup all VMs residing on this host
    ./ghettoVCB.sh -a

Backup all VMs residing on this host except for the VMs in the exclusion list
    ./ghettoVCB.sh -a -e vm_exclusion_list

Backup VMs based on specific configuration located in directory
    ./ghettoVCB.sh -f vms_to_backup -c vm_backup_configs

Backup VMs using global ghettoVCB configuration file
    ./ghettoVCB.sh -f vms_to_backup -g /global/ghettoVCB.conf

Output will log to /tmp/ghettoVCB.log (consider logging to local or remote datastore to persist logs)
    ./ghettoVCB.sh -f vms_to_backup -l /vmfs/volume/local-storage/ghettoVCB.log

Dry run (no backup will take place)
    ./ghettoVCB.sh -f vms_to_backup -d dryrun

The input to this script is a file that contains the display name of the  virtual machine(s) separated by a newline. When creating this file on a  non-Linux/UNIX system, you may introduce ^M character which can cause  the script to miss-behave. To ensure this does not occur, plesae create  the file on the ESX/ESXi host.

Here is a sample of what the file would look like:

[root@himalaya ~]# cat vms_to_backup
vCOPS
vMA
vCloudConnector

 


 

Sample Execution:

  • Dry run Mode
  • Debug Mode
  • Backup VMs stored in a list
  • Backup Single VM using command-line
  • Backup All VMs residing on specific ESX(i) host
  • Backup VMs based on individual VM backup policies

 

Dry run Mode (no backup will take place)

Note: This execution mode provides a qucik summary of details on whether a given set of VM(s)/VMDK(s) will be backed up. It provides additional information such as VMs that may have snapshots, VMDK(s) that are configured as independent disks, or other issues that may cause a VM or VMDK to not backed up.

 

  • Log verbosity: dryrun
  • Log output: stdout & /tmp (default)
    • Logs by default will be stored in /tmp, these log files may not persist through reboots, especially when dealing with ESXi. You should log to either a local or remote datastore to ensure that logs are kept upon a reboot.
[root@himalaya ghettoVCB]# ./ghettoVCB.sh -f vms_to_backup -d dryrun
Logging output to "/tmp/ghettoVCB-2011-03-13_15-19-57.log" ...
2011-03-13 15:19:57 -- info: ============================== ghettoVCB LOG START ==============================

2011-03-13 15:19:57 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:19:57 -- info: CONFIG - GHETTOVCB_PID = 30157
2011-03-13 15:19:57 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:19:57 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:19:57 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-19-57
2011-03-13 15:19:57 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:19:57 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:19:57 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:19:57 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2011-03-13 15:19:57 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:19:57 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:19:57 -- info: CONFIG - LOG_LEVEL = dryrun
2011-03-13 15:19:57 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2011-03-13_15-19-57.log
2011-03-13 15:19:57 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:19:57 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:19:57 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2011-03-13 15:19:57 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:19:57 -- info:
2011-03-13 15:19:57 -- dryrun: ###############################################
2011-03-13 15:19:57 -- dryrun: Virtual Machine: scofield
2011-03-13 15:19:57 -- dryrun: VM_ID: 704
2011-03-13 15:19:57 -- dryrun: VMX_PATH: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield.vmx
2011-03-13 15:19:57 -- dryrun: VMX_DIR: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield
2011-03-13 15:19:57 -- dryrun: VMX_CONF: scofield/scofield.vmx
2011-03-13 15:19:57 -- dryrun: VMFS_VOLUME: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:19:57 -- dryrun: VMDK(s):
2011-03-13 15:19:58 -- dryrun:  scofield_3.vmdk 3 GB
2011-03-13 15:19:58 -- dryrun:  scofield_2.vmdk 2 GB
2011-03-13 15:19:58 -- dryrun:  scofield_1.vmdk 1 GB
2011-03-13 15:19:58 -- dryrun:  scofield.vmdk   5 GB
2011-03-13 15:19:58 -- dryrun: INDEPENDENT VMDK(s):
2011-03-13 15:19:58 -- dryrun: TOTAL_VM_SIZE_TO_BACKUP: 11 GB
2011-03-13 15:19:58 -- dryrun: ###############################################

2011-03-13 15:19:58 -- dryrun: ###############################################
2011-03-13 15:19:58 -- dryrun: Virtual Machine: vMA
2011-03-13 15:19:58 -- dryrun: VM_ID: 1440
2011-03-13 15:19:58 -- dryrun: VMX_PATH: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vMA/vMA.vmx
2011-03-13 15:19:58 -- dryrun: VMX_DIR: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vMA
2011-03-13 15:19:58 -- dryrun: VMX_CONF: vMA/vMA.vmx
2011-03-13 15:19:58 -- dryrun: VMFS_VOLUME: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:19:58 -- dryrun: VMDK(s):
2011-03-13 15:19:58 -- dryrun:  vMA-000002.vmdk 5 GB
2011-03-13 15:19:58 -- dryrun: INDEPENDENT VMDK(s):
2011-03-13 15:19:58 -- dryrun: TOTAL_VM_SIZE_TO_BACKUP: 5 GB
2011-03-13 15:19:58 -- dryrun: Snapshots found for this VM, please commit all snapshots before continuing!
2011-03-13 15:19:58 -- dryrun: THIS VIRTUAL MACHINE WILL NOT BE BACKED UP DUE TO EXISTING SNAPSHOTS!
2011-03-13 15:19:58 -- dryrun: ###############################################

2011-03-13 15:19:58 -- dryrun: ###############################################
2011-03-13 15:19:58 -- dryrun: Virtual Machine: vCloudConnector
2011-03-13 15:19:58 -- dryrun: VM_ID: 2064
2011-03-13 15:19:58 -- dryrun: VMX_PATH: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector/vCloudConnector.vmx
2011-03-13 15:19:58 -- dryrun: VMX_DIR: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector
2011-03-13 15:19:58 -- dryrun: VMX_CONF: vCloudConnector/vCloudConnector.vmx
2011-03-13 15:19:58 -- dryrun: VMFS_VOLUME: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:19:58 -- dryrun: VMDK(s):
2011-03-13 15:19:59 -- dryrun:  vCloudConnector.vmdk    3 GB
2011-03-13 15:19:59 -- dryrun: INDEPENDENT VMDK(s):
2011-03-13 15:19:59 -- dryrun:  vCloudConnector_1.vmdk  40 GB
2011-03-13 15:19:59 -- dryrun: TOTAL_VM_SIZE_TO_BACKUP: 3 GB
2011-03-13 15:19:59 -- dryrun: Snapshots can not be taken for indepdenent disks!
2011-03-13 15:19:59 -- dryrun: THIS VIRTUAL MACHINE WILL NOT HAVE ALL ITS VMDKS BACKED UP!
2011-03-13 15:19:59 -- dryrun: ###############################################

2011-03-13 15:19:59 -- info: ###### Final status: OK, only a dryrun. ######

2011-03-13 15:19:59 -- info: ============================== ghettoVCB LOG END ================================

In the example above, we have 3 VMs to be backed up:

  • scofield has 4 VMDK(s) that total up to 11GB and does not contain any snapshots/independent disks and this VM should backup without any issues
  • vMA has 1 VMDK but it also contains a snapshot and clearly this VM will not be backed up until the snapshot has been committed
  • vCloudConnector has 2 VMDK(s), one which is 3GB and another which is 40GB and configured as an independent disk. Since snapshots do not affect independent disk, only the 3GB VMDK will be backed up for this VM as denoted by the “TOTAL_VM_SIZE_TO_BACKUP

Debug backup mode

Note: This execution modes provides more in-depth information about environment/backup process including additional storage debugging information which provides information about both the source/destination datastore pre and post backups. This can be very useful in troubleshooting backups

 

  • Log verbosity: debug
  • Log output: stdout & /tmp (default)
    • Logs by default will be stored in /tmp, these log files may not persist  through reboots, especially when dealing with ESXi. You should log to  either a local or remote datastore to ensure that logs are kept upon a  reboot.
[root@himalaya ghettoVCB]# ./ghettoVCB.sh -f vms_to_backup -d debug
Logging output to "/tmp/ghettoVCB-2011-03-13_15-27-59.log" ...
2011-03-13 15:27:59 -- info: ============================== ghettoVCB LOG START ==============================

2011-03-13 15:27:59 -- debug: Succesfully acquired lock directory - /tmp/ghettoVCB.lock

2011-03-13 15:27:59 -- debug: HOST VERSION: VMware ESX 4.1.0 build-260247
2011-03-13 15:27:59 -- debug: HOST LEVEL: VMware ESX 4.1.0 GA
2011-03-13 15:27:59 -- debug: HOSTNAME: himalaya.primp-industries.com

2011-03-13 15:27:59 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:27:59 -- info: CONFIG - GHETTOVCB_PID = 31074
2011-03-13 15:27:59 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:27:59 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:27:59 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-27-59
2011-03-13 15:27:59 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:27:59 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:27:59 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:27:59 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2011-03-13 15:27:59 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:27:59 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:27:59 -- info: CONFIG - LOG_LEVEL = debug
2011-03-13 15:27:59 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2011-03-13_15-27-59.log
2011-03-13 15:27:59 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:27:59 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:27:59 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2011-03-13 15:27:59 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:27:59 -- info:
2011-03-13 15:28:01 -- debug: Storage Information before backup:
2011-03-13 15:28:01 -- debug: SRC_DATASTORE: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:28:01 -- debug: SRC_DATASTORE_CAPACITY: 1830.5 GB
2011-03-13 15:28:01 -- debug: SRC_DATASTORE_FREE: 539.4 GB
2011-03-13 15:28:01 -- debug: SRC_DATASTORE_BLOCKSIZE: 4
2011-03-13 15:28:01 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 1024 GB
2011-03-13 15:28:01 -- debug:
2011-03-13 15:28:01 -- debug: DST_DATASTORE: dlgCore-NFS-bigboi.VM-Backups
2011-03-13 15:28:01 -- debug: DST_DATASTORE_CAPACITY: 1348.4 GB
2011-03-13 15:28:01 -- debug: DST_DATASTORE_FREE: 296.8 GB
2011-03-13 15:28:01 -- debug: DST_DATASTORE_BLOCKSIZE: NA
2011-03-13 15:28:01 -- debug: DST_DATASTORE_MAX_FILE_SIZE: NA
2011-03-13 15:28:01 -- debug:
2011-03-13 15:28:02 -- info: Initiate backup for scofield
2011-03-13 15:28:02 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_3.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/scofield/scofield-2011-03-13_15-27-59/scofield_3.vmdk"
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_3.vmdk'...
Clone: 37% done.
2011-03-13 15:28:04 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_2.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/scofield/scofield-2011-03-13_15-27-59/scofield_2.vmdk"
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_2.vmdk'...
Clone: 85% done.
2011-03-13 15:28:05 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_1.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/scofield/scofield-2011-03-13_15-27-59/scofield_1.vmdk"

2011-03-13 15:28:06 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/scofield/scofield-2011-03-13_15-27-59/scofield.vmdk"
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield.vmdk'...
Clone: 78% done.
2011-03-13 15:29:52 -- info: Backup Duration: 1.83 Minutes
2011-03-13 15:29:52 -- info: Successfully completed backup for scofield!

2011-03-13 15:29:54 -- debug: Storage Information after backup:
2011-03-13 15:29:54 -- debug: SRC_DATASTORE: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:29:54 -- debug: SRC_DATASTORE_CAPACITY: 1830.5 GB
2011-03-13 15:29:54 -- debug: SRC_DATASTORE_FREE: 539.4 GB
2011-03-13 15:29:54 -- debug: SRC_DATASTORE_BLOCKSIZE: 4
2011-03-13 15:29:54 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 1024 GB
2011-03-13 15:29:54 -- debug:
2011-03-13 15:29:54 -- debug: DST_DATASTORE: dlgCore-NFS-bigboi.VM-Backups
2011-03-13 15:29:54 -- debug: DST_DATASTORE_CAPACITY: 1348.4 GB
2011-03-13 15:29:54 -- debug: DST_DATASTORE_FREE: 296.8 GB
2011-03-13 15:29:54 -- debug: DST_DATASTORE_BLOCKSIZE: NA
2011-03-13 15:29:54 -- debug: DST_DATASTORE_MAX_FILE_SIZE: NA
2011-03-13 15:29:54 -- debug:
2011-03-13 15:29:55 -- debug: Storage Information before backup:
2011-03-13 15:29:55 -- debug: SRC_DATASTORE: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:29:55 -- debug: SRC_DATASTORE_CAPACITY: 1830.5 GB
2011-03-13 15:29:55 -- debug: SRC_DATASTORE_FREE: 539.4 GB
2011-03-13 15:29:55 -- debug: SRC_DATASTORE_BLOCKSIZE: 4
2011-03-13 15:29:55 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 1024 GB
2011-03-13 15:29:55 -- debug:
2011-03-13 15:29:55 -- debug: DST_DATASTORE: dlgCore-NFS-bigboi.VM-Backups
2011-03-13 15:29:55 -- debug: DST_DATASTORE_CAPACITY: 1348.4 GB
2011-03-13 15:29:55 -- debug: DST_DATASTORE_FREE: 296.8 GB
2011-03-13 15:29:55 -- debug: DST_DATASTORE_BLOCKSIZE: NA
2011-03-13 15:29:55 -- debug: DST_DATASTORE_MAX_FILE_SIZE: NA
2011-03-13 15:29:55 -- debug:
2011-03-13 15:29:55 -- info: Snapshot found for vMA, backup will not take place

2011-03-13 15:29:57 -- debug: Storage Information before backup:
2011-03-13 15:29:57 -- debug: SRC_DATASTORE: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:29:57 -- debug: SRC_DATASTORE_CAPACITY: 1830.5 GB
2011-03-13 15:29:57 -- debug: SRC_DATASTORE_FREE: 539.4 GB
2011-03-13 15:29:57 -- debug: SRC_DATASTORE_BLOCKSIZE: 4
2011-03-13 15:29:57 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 1024 GB
2011-03-13 15:29:57 -- debug:
2011-03-13 15:29:57 -- debug: DST_DATASTORE: dlgCore-NFS-bigboi.VM-Backups
2011-03-13 15:29:57 -- debug: DST_DATASTORE_CAPACITY: 1348.4 GB
2011-03-13 15:29:57 -- debug: DST_DATASTORE_FREE: 296.8 GB
2011-03-13 15:29:57 -- debug: DST_DATASTORE_BLOCKSIZE: NA
2011-03-13 15:29:57 -- debug: DST_DATASTORE_MAX_FILE_SIZE: NA
2011-03-13 15:29:57 -- debug:
2011-03-13 15:29:58 -- info: Initiate backup for vCloudConnector
2011-03-13 15:29:58 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector/vCloudConnector.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/vCloudConnector/vCloudConnector-2011-03-13_15-27-59/vCloudConnector.vmdk"
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector/vCloudConnector.vmdk'...
Clone: 97% done.
2011-03-13 15:30:45 -- info: Backup Duration: 47 Seconds
2011-03-13 15:30:45 -- info: WARN: vCloudConnector has some Independent VMDKs that can not be backed up!

2011-03-13 15:30:45 -- info: ###### Final status: ERROR: Only some of the VMs backed up, and some disk(s) failed! ######

2011-03-13 15:30:45 -- debug: Succesfully removed lock directory - /tmp/ghettoVCB.lock

2011-03-13 15:30:45 -- info: ============================== ghettoVCB LOG END ================================

Backup VMs stored in a list

[root@himalaya ~]# ./ghettoVCB.sh -f vms_to_backup

Backup Single VM using command-line

# ./ghettoVCB.sh -m MyVM

Backup All VMs residing on specific ESX(i) host

/ghettoVCB # ./ghettoVCB.sh -a

Backup All VMs residing on specific ESX(i) host and exclude the VMs in the exclusion list

/ghettoVCB # ./ghettoVCB.sh -a -e vm_exclusion_list

 

Backup VMs based on individual VM backup policies and log output to /tmp/ghettoVCB.log

  • Log verbosity: info (default)
  • Log output: /tmp/ghettoVCB.log
    • Logs by default will be stored in /tmp, these log files may not persist  through reboots, especially when dealing with ESXi. You should log to  either a local or remote datastore to ensure that logs are kept upon a  reboot.

1. Create folder to hold individual VM backup policies (can be named anything):

[root@himalaya ~]# mkdir backup_config

2. Create individual VM backup policies for each VM that ensure each  file is named exactly as the display name of the VM being backed up (use  provided template to create duplicates):

[root@himalaya backup_config]# cp ghettoVCB-vm_backup_configuration_template scofield
[root@himalaya backup_config]# cp ghettoVCB-vm_backup_configuration_template vCloudConnector

Listing of VM backup policy within backup configuration directory

[root@himalaya backup_config]# ls
ghettoVCB-vm_backup_configuration_template  scofield  vCloudConnector  

Backup policy for “scofield” (backup only 2 specific VMDKs)

[root@himalaya backup_config]# cat scofield
VM_BACKUP_VOLUME=/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
DISK_BACKUP_FORMAT=thin
VM_BACKUP_ROTATION_COUNT=3
POWER_VM_DOWN_BEFORE_BACKUP=0
ENABLE_HARD_POWER_OFF=0
ITER_TO_WAIT_SHUTDOWN=4
POWER_DOWN_TIMEOUT=5
SNAPSHOT_TIMEOUT=15
ENABLE_COMPRESSION=0
VM_SNAPSHOT_MEMORY=0
VM_SNAPSHOT_QUIESCE=0
VMDK_FILES_TO_BACKUP="scofield_2.vmdk,scofield_1.vmdk"

Backup policy for VM “vCloudConnector” (backup all VMDKs found)

[root@himalaya backup_config]# cat vCloudConnector
VM_BACKUP_VOLUME=/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
DISK_BACKUP_FORMAT=thin
VM_BACKUP_ROTATION_COUNT=3
POWER_VM_DOWN_BEFORE_BACKUP=0
ENABLE_HARD_POWER_OFF=0
ITER_TO_WAIT_SHUTDOWN=4
POWER_DOWN_TIMEOUT=5
SNAPSHOT_TIMEOUT=15
ENABLE_COMPRESSION=0
VM_SNAPSHOT_MEMORY=0
VM_SNAPSHOT_QUIESCE=0
VMDK_FILES_TO_BACKUP="vCloudConnector.vmdk"

Note: When specifying -c option (individual VM backup policy mode) if a VM is listed in the backup list but DOES NOT have a corresponding backup policy, the VM will be backed up using the  default configuration found within the ghettoVCB.sh script.

Execution of backup

[root@himalaya ~]# ./ghettoVCB.sh -f vms_to_backup -c backup_config -l /tmp/ghettoVCB.log

2011-03-13 15:40:50 -- info: ============================== ghettoVCB LOG START ==============================

2011-03-13 15:40:51 -- info: CONFIG - USING CONFIGURATION FILE = backup_config//scofield
2011-03-13 15:40:51 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:40:51 -- info: CONFIG - GHETTOVCB_PID = 2967
2011-03-13 15:40:51 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:40:51 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:40:51 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-40-50
2011-03-13 15:40:51 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:40:51 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:40:51 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:40:51 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 4
2011-03-13 15:40:51 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:40:51 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:40:51 -- info: CONFIG - LOG_LEVEL = info
2011-03-13 15:40:51 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB.log
2011-03-13 15:40:51 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:40:51 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:40:51 -- info: CONFIG - VMDK_FILES_TO_BACKUP = scofield_2.vmdk,scofield_1.vmdk
2011-03-13 15:40:51 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:40:51 -- info:
2011-03-13 15:40:53 -- info: Initiate backup for scofield
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_2.vmdk'...
Clone: 100% done.

Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_1.vmdk'...
Clone: 100% done.

2011-03-13 15:40:55 -- info: Backup Duration: 2 Seconds
2011-03-13 15:40:55 -- info: Successfully completed backup for scofield!

2011-03-13 15:40:57 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:40:57 -- info: CONFIG - GHETTOVCB_PID = 2967
2011-03-13 15:40:57 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:40:57 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:40:57 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-40-50
2011-03-13 15:40:57 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:40:57 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:40:57 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:40:57 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2011-03-13 15:40:57 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:40:57 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:40:57 -- info: CONFIG - LOG_LEVEL = info
2011-03-13 15:40:57 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB.log
2011-03-13 15:40:57 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:40:57 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:40:57 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2011-03-13 15:40:57 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:40:57 -- info:
2011-03-13 15:40:59 -- info: Snapshot found for vMA, backup will not take place

2011-03-13 15:40:59 -- info: CONFIG - USING CONFIGURATION FILE = backup_config//vCloudConnector
2011-03-13 15:40:59 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:40:59 -- info: CONFIG - GHETTOVCB_PID = 2967
2011-03-13 15:40:59 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:40:59 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:40:59 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-40-50
2011-03-13 15:40:59 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:40:59 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:40:59 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:40:59 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 4
2011-03-13 15:40:59 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:40:59 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:40:59 -- info: CONFIG - LOG_LEVEL = info
2011-03-13 15:40:59 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB.log
2011-03-13 15:40:59 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:40:59 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:40:59 -- info: CONFIG - VMDK_FILES_TO_BACKUP = vCloudConnector.vmdk
2011-03-13 15:40:59 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:40:59 -- info:
2011-03-13 15:41:01 -- info: Initiate backup for vCloudConnector
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector/vCloudConnector.vmdk'...
Clone: 100% done.

2011-03-13 15:41:51 -- info: Backup Duration: 50 Seconds
2011-03-13 15:41:51 -- info: WARN: vCloudConnector has some Independent VMDKs that can not be backed up!

2011-03-13 15:41:51 -- info: ###### Final status: ERROR: Only some of the VMs backed up, and some disk(s) failed! ######

2011-03-13 15:41:51 -- info: ============================== ghettoVCB LOG END ================================

 

 


 

Enable compression for backups (EXPERIMENTAL SUPPORT)

Please take a look at FAQ #25 for more details before continuing

To make use of this feature, modify the variable ENABLE_COMPRESSION from 0 to 1. Please note, do not mix uncompressed backups with  compressed backups. Ensure that directories selected for backups do not contain any backups with previous versions of ghettoVCB before enabling  and implementing the compressed backups feature.

 


 

Email Backup Logs (EXPERIMENTAL SUPPORT)

nc (netcat) utility must be present for email support to function, this utility is a now a default with the release of vSphere 4.1 or greater, previous releases of VI 3.5 and/or vSphere 4.0 does not contain this utility. The reason this is listed as experimental is it may not be compatible with all email servers as the script utlizes nc (netcat) utility to communicate to an email server. This feature is  provided as-is with no guarantees. If you enable this feature, a  separate log will be generated along side  any normal logging which will  be used to email recipient. If for whatever reason, the email fails to  send, an entry will appear per the normal logging mechanism.

 

Users should also make note due to limited functionality of netcat, it uses SMTP pipelining which is not the most ideal method of communicating with an SMTP server. Email from ghettoVCB may not work if your email server does not support this feature.

 

You can define an email recipient in the following two ways:

 

EMAIL_TO=william@virtuallyghetto.com

OR

EMAIL_TO=william@virtuallyghetto.com,tuan@virtuallyghetto.com

 

If you are running ESXi 5.1, you will need to create a custom firewall rule to allow your email traffic to go out which I will assume is default port 25. Here are the steps for creating a custom email rule.

 

Step 1 – Create a file called /etc/vmware/firewall/email.xml with contains the following:

<ConfigRoot>
  <service>
    <id>email</id>
    <rule id="0000">
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>25</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>
</ConfigRoot>

 

Step 2 – Reload the ESXi firewall by running the following ESXCLI command:

~ #
esxcli network firewall refresh

Step 3 – Confirm that your email rule has been loaded by running the following ESXCLI command:

~ # esxcli network firewall ruleset list | grep email
email                  true

Step 4 – Connect to your email server by usingn nc (netcat) by running the following command and specifying the IP Address/Port of your email server:

~ # nc 172.30.0.107 25
220 mail.primp-industries.com ESMTP Postfix

You should recieve a response from your email server and you can enter Ctrl+C to exit. This custom ESXi firewall rule will not persist after a reboot, so you should create a custom VIB to ensure it persists after a system reboot. Please take a look at this article for the details.

 


 

Rsync Support  (EXPERIMENTAL SUPPORT)

To make use of this feature, modify the variable RSYNC_LINK from 0  to 1. Please note, this is an experimental feature request from users that rely on rsync to replicate changes from one datastore volume to  another datastore volume. The premise of this feature is to have a standardized folder that rsync can monitor for changes to replicate to  another backup datastore. When this feature is enabled, a symbolic link  will be generated with the format of “<VMNAME>-symlink” and will  reference the latest successful VM backup. You can then rely on this  symbolic link to watch for changes and replicate to your backup  datastore.

Here is an example of what this would look like:

[root@himalaya ghettoVCB]# ls -la /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/vcma/
total 0
drwxr-xr-x 1 nobody nobody 110 Sep 27 08:08 .
drwxr-xr-x 1 nobody nobody  17 Sep 16 14:01 ..
lrwxrwxrwx 1 nobody nobody  89 Sep 27 08:08 vcma-symlink -> /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/vcma/vcma-2010-09-27_08-07-37
drwxr-xr-x 1 nobody nobody  58 Sep 27 08:04 vcma-2010-09-27_08-04-26
drwxr-xr-x 1 nobody nobody  58 Sep 27 08:06 vcma-2010-09-27_08-05-55
drwxr-xr-x 1 nobody nobody  58 Sep 27 08:08 vcma-2010-09-27_08-07-37

FYI – This feature has not been tested, please provide feedback if this does not work as expected.


 

Restore backups (ghettoVCB-restore.sh):

To recover a VM that has been processed by ghettoVCB, please take a look at this document: Ghetto Tech Preview – ghettoVCB-restore.sh – Restoring VM’s backed up from ghettoVCB to ESX(i) 3.5, 4.x, and 5.x

 


Stopping ghettoVCB Process:

There may be a situation where you need to stop the ghettoVCB process and entering Ctrl+C will only kill off the main ghettoVCB process, however there may still be other spawn processes that you may need to identify and stop. Below are two scenarios you may encounter and the process to completely stop all processes related to ghettoVCB.

 

Interactively running ghettoVCB:

 

Step 1 – Press Ctrl+C which will kill off the main ghettoVCB instance

 

Step 2 – Search for any existing ghettoVCB process by running the following:

 

# ps -c | grep ghettoVCB | grep -v grep
3360136 3360136 tail                 tail -f /tmp/ghettoVCB.work/ghettovcb.Cs1M1x

 

Step 3 – Here we can see there is a tail command that was used in the script. We need to stop this process by using the kill command which accepts the PID (Process ID) which is identified by the first value on the far left hand side of the command. In this example, it is 3360136.

# kill -9 3360136

 

Note: Make sure you identify the correct PID, else you could accidently impact a running VM or worse your ESXi host.

 

Step 4 – Depending on where you stopped the ghettoVCB process, you may need to consolidate or remove any existing snapshots that may exist on the VM that was being backed up. You can easily do so by using the vSphere Client.

 

Non-Interactively running ghettoVCB:

 

Step 1 – Search for the ghettoVCB process (you can also validate the PID from the logs)

 

~ # ps -c | grep ghettoVCB | grep -v grep
3360393 3360393 busybox              ash ./ghettoVCB.sh -f list -d debug
3360790 3360790 tail                 tail -f /tmp/ghettoVCB.work/ghettovcb.deGeB7

 

Step 2 – Stop both the main ghettoVCB instance & tail command by using the kill command and specifying their respective PID IDs:

 

kill -9 3360393
kill -9 3360790

 

Step 3 – If a VM was in the process of being backed up, there is an additional process for the actual vmkfstools copy. You will need to identify the process for that and kill that as well. We will again use ps -c command and search for any vmkfstools that are running:

# ps -c | grep vmkfstools | grep -v grep
3360796 3360796 vmkfstools           /sbin/vmkfstools -i /vmfs/volumes/himalaya-temporary/VC-Windows/VC-Windows.vmdk -a lsilogic -d thin /vmfs/volumes/test-dont-use-this-volume/backups/VC-Windows/VC-Windows-2013-01-26_16-45-35/VC-Windows.vmdk

 

 

Step 4 – In case there is someone manually running a vmkfstools, make sure you take a look at the command itself and that it maps back to the current VM that was being backed up before kill the process. Once you have identified the proper PID, go ahead and use the kill command:

# kill -9 3360796

 

Step 5 – Depending on where you stopped the  ghettoVCB process, you may need to consolidate or remove any existing  snapshots that may exist on the VM that was being backed up. You can  easily do so by using the vSphere Client.

 


 

Cronjob FAQ:

Please take a moment to read over what is a cronjob and how to set one up, before continuing

The task of configuring cronjobs on classic ESX servers (with Service Console) is no different than traditional cronjobs on *nix operating  systems (this procedure is outlined in the link above). With ESXi on the  other hand, additional factors need to be taken into account when  setting up cronjobs in the limited shell console called Busybox because changes made do not persist through a system reboot. The following document will outline steps to ensure that cronjob configurations are saved and present upon a reboot.

 

Important Note: Always redirect the ghettoVCB output to /dev/null and/or to a log when automating via cron, this becomes very important as one user has identified a limited amount of buffer capacity in which once filled, may cause ghettoVCB to stop in the middle of a backup. This primarily only affects users on ESXi, but it is good practice to always redirect the output. Also ensure you are specifying the FULL PATH when referencing the ghettoVCB script, input or log files.

 

e.g.

0 0 * * 1-5 /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB.sh -f /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/backuplist > /dev/null

or

0 0 * * 1-5 /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB.sh -f /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/backuplist > /tmp/ghettoVCB.log

 

Task: Configure ghettoVCB.sh to execute a backup five days a week (M-F) at 12AM (midnight) everyday and send output to a unique log file

Configure on ESX:

1. As root, you’ll install your cronjob by issuing:

[root@himalaya ~]# crontab -e

2. Append the following entry:

0 0 * * 1-5 /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB.sh -f /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/backuplist > /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB-backup-$(date +\%s).log

3. Save and exit

[root@himalaya dlgCore-NFS-bigboi.VM-Backups]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab

4. List out and verify the cronjob that was just created:

[root@himalaya dlgCore-NFS-bigboi.VM-Backups]# crontab -l
0 0 * * 1-5 /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB.sh -f /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/backuplist > /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB-backup-$(date +\%s).log

You’re ready to go!

Configure on ESXi:

1. Setup the cronjob by appending the following line to /var/spool/cron/crontabs/root:

0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-$(date +\%s).log

 

If you are unable to edit/modify /var/spool/cron/crontabs/root, please make a copy and then edit the copy with the changes

cp /var/spool/cron/crontabs/root /var/spool/cron/crontabs/root.backup

Once your changes have been made, then “mv” the backup to the original file. This may occur on ESXi 4.x or 5.x hosts

mv /var/spool/cron/crontabs/root.backup /var/spool/cron/crontabs/root

You can now verify the crontab entry has been updated by using “cat” utility.
2. Kill the current crond (cron daemon) and then restart the crond for the changes to take affect:

On ESXi < 3.5u3

kill $(ps | grep crond | cut -f 1 -d ' ')

On ESXi 3.5u3+

~ # kill $(pidof crond)
~ # crond

On ESXi 4.x/5.0

~ # kill $(cat /var/run/crond.pid)
~ # busybox crond

 

On ESXi 5.1

~ # kill $(cat /var/run/crond.pid)
~ # crond

3. Now that the cronjob is ready to go, you need to ensure that this  cronjob will persist through a reboot. You’ll need to add the following two lines to /etc/rc.local (ensure that the cron entry matches what was defined above). In ESXi 5.1, you will need to edit /etc/rc.local.d/local.sh instead of /etc/rc.local as that is no longer valid.

On ESXi 3.5

/bin/kill $(pidof crond)
/bin/echo "0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
crond

On ESXi 4.x/5.0

/bin/kill $(cat /var/run/crond.pid)
/bin/echo "0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
/bin/busybox crond

 

On ESXi 5.1

/bin/kill $(cat /var/run/crond.pid)
/bin/echo "0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
crond

Afterwards the file should look like the following:

~ # cat /etc/rc.local
#! /bin/ash
export PATH=/sbin:/bin

log() {
   echo "$1"
   logger init "$1"
}

#execute all service retgistered in /etc/rc.local.d
if [http:// -d /etc/rc.local.d |http:// -d /etc/rc.local.d ]; then
   for filename in `find /etc/rc.local.d/ | sort`
      do
         if [ -f $filename ] && [ -x $filename ]; then
            log "running $filename"
            $filename
         fi
      done
fi

/bin/kill $(cat /var/run/crond.pid)
/bin/echo "0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
/bin/busybox crond

This will ensure that the cronjob is re-created upon a reboot of the system through a startup script

2. To ensure that this is saved in the ESXi configuration, we need to manually initiate an ESXi backup by running:

~ # /sbin/auto-backup.sh
config implicitly loaded
local.tgz
etc/vmware/vmkiscsid/vmkiscsid.db
etc/dropbear/dropbear_dss_host_key
etc/dropbear/dropbear_rsa_host_key
etc/opt/vmware/vpxa/vpxa.cfg
etc/opt/vmware/vpxa/dasConfig.xml
etc/sysconfig/network
etc/vmware/hostd/authorization.xml
etc/vmware/hostd/hostsvc.xml
etc/vmware/hostd/pools.xml
etc/vmware/hostd/vmAutoStart.xml
etc/vmware/hostd/vmInventory.xml
etc/vmware/hostd/proxy.xml
etc/vmware/ssl/rui.crt
etc/vmware/ssl/rui.key
etc/vmware/vmkiscsid/initiatorname.iscsi
etc/vmware/vmkiscsid/iscsid.conf
etc/vmware/vmware.lic
etc/vmware/config
etc/vmware/dvsdata.db
etc/vmware/esx.conf
etc/vmware/license.cfg
etc/vmware/locker.conf
etc/vmware/snmp.xml
etc/group
etc/hosts
etc/inetd.conf
etc/rc.local
etc/chkconfig.db
etc/ntp.conf
etc/passwd
etc/random-seed
etc/resolv.conf
etc/shadow
etc/sfcb/repository/root/interop/cim_indicationfilter.idx
etc/sfcb/repository/root/interop/cim_indicationhandlercimxml.idx
etc/sfcb/repository/root/interop/cim_listenerdestinationcimxml.idx
etc/sfcb/repository/root/interop/cim_indicationsubscription.idx
Binary files /etc/vmware/dvsdata.db and /tmp/auto-backup.31345.dir/etc/vmware/dvsdata.db differ
config implicitly loaded
Saving current state in /bootbank
Clock updated.
Time: 20:40:36   Date: 08/14/2009   UTC

Now you’re really done!

If you’re still having trouble getting the cronjob to work, ensure that  you’ve specified the correct parameters and there aren’t any typos in  any part of the syntax.

Ensure crond (cron daemon) is running:

ESX 3.x/4.0:

[root@himalaya dlgCore-NFS-bigboi.VM-Backups]# ps -ef | grep crond | grep -v grep
root      2625     1  0 Aug13 ?        00:00:00 crond

ESXi 3.x/4.x/5.x:

~ # ps | grep crond | grep -v grep
5196 5196 busybox              crond

 

Ensure that the date/time on your ESX(i) host is setup correctly:

ESX(i):

[root@himalaya dlgCore-NFS-bigboi.VM-Backups]# date
Fri Aug 14 23:44:47 PDT 2009

 

Note: Careful attention must be noted if more than one backup is performed per day. Backup windows  should be staggered to avoid contention or saturation of resources  during these periods.

 


 

FAQ:

0Q: I’m getting error X when using the script or I’m not getting any errors, the backup didn’t even take place. What can I do?
0A: First off, before posting a comment/question, please thoroughly read through the ENTIRE documentation including the FAQs to see if your question has already been ansered.

1Q: I’ve read through the entire documentation + FAQs and still have not found my answer to the problem I’m seeing. What can I do?
1A: Please join the ghettoVCB Group to post your question/comment.

 

2Q: I’ve sent you private message or email but I haven’t received a response? What gives?
2A: I do not accept issues/bugs reported via PM or email, I will  reply back, directing you to post on the appropriate VMTN forum (that’s  what it’s for). If the data/results you’re providing is truely senstive  to your environment I will hear you out, but 99.99% it is not, so please  do not messsage/email me directly. I do monitor all forums that contain  my script including the normal VMTN forums and will try to get back to  your question as soon as I can and as time permits. Please do be patient as you’re not the only person using the script (600,000+ views), thank you.

3Q: Can I schedule backups to take place hourly, daily, monthly, yearly?
3A: Yes, do a search online for crontab.

4Q: I would like to setup cronjob for ESX(i) 3.5 or 4.0?
4A: Take a look at the Cronjob FAQ section in this document.

5Q: I want to schedule my backup on Windows, how do I do this?
5A: Do a search for plink. Make sure you have paired SSH keys setup between your Windows system and ESX/ESXi host.

6Q: I only have a single ESXi host. I want to take backups and  store them somewhere else. The problem is: I don’t have NFS, iSCSI nor  FC SAN. What can I do?
6A: You can use local storage to store your backups assuming that  you have enough space on the destination datastore.  Afterwards, you  can use scp (WinSCP/FastSCP) to transfer the backups from the ESXi host  to your local desktop.

7Q: I’m pissed; the backup is taking too long. My datastore is of type X?
7A: YMMV, take a look at your storage configuration and make sure it is optimized.

8Q: I noticed that the backup rotation is occurring after a  backup. I don’t have enough local storage space, can the process be  changed?
8A: This is primarily done to ensure that you have at least one  good backup in case the new backup fails. If you would like to modify  the script, you’re more than welcome to do so.

9Q: What is the best storage configuration for datastore type X?
9A: Search the VMTN forums; there are various configurations for the different type of storage/etc.

10Q: I want to setup an NFS server to run my backups. Which is the best and should it be virtual or physical?
10A: Please refer to answer 7A. From experience, we’ve seen  physical instances of NFS servers to be faster than their virtual  counterparts. As always, YMMV.

11Q: I have VMs that have snapshots. I want to back these things up but the script doesn’t let me do it. How do I fix that?
11A: VM snapshots are not meant to be kept for long durations.  When backing up a VM that contains a snapshot, you should ensure all snapshots have been committed prior to running a backup. No exceptions  will be made…ever.

12Q: I would like to restore from backup, what is the best method?
12A: The restore process will be unique for each environment and  should be determined by your backup/recovery plans. At a high level you have the option of mounting the backup datastore and registering the VM  in question or copy the VM from the backup datastore to the ESX/ESXi  host. The latter is recommended so that you’re not running a VM living  on the backup datastore or inadvertently modifying your backup VM(s). You can also take a look at ghettoVCB-restore which is experimentally supported.

13Q: When I try to run the script I get: “-bash: ./ghettoVCB.sh: Permission denied”, what is wrong?
13A: You need to change the permission on the script to be executable, chmod +x ghettoVCB.sh

14Q: Where can I download the latest version of the script?
14A: The latest version is available on on github – https://github.com/lamw/ghettoVCB/downloads

15Q: I would like to suggest/recommend feature X, can I get it?  When can I get it? Why isn’t it here, what gives?
15A: The general purpose of this script is to provide a backup  solution around VMware VMs. Any additional features outside of that  process will be taken into consideration depending on the amount of  time, number of requests and actual usefulness as a whole to the  community rather than to an individual.

16Q: I have found this script to be very useful and would like to contribute back, what can I do?
16A: To continue to develop and share new scripts and resources with the community, we need your support. You can donate here Thank You!

17Q: What are the different type of backup uses cases that are supported with ghettoVCB?
17A: 1) Live backup of VM with the use of a snapshot and 2)  Offline backup of a VM without a snapshot. These are the only two use  cases supported by the script.

18Q: When I execute the script on ESX(i) I get some funky errors such as “: not found.sh” or “command not found”. What is this?
18A: Most likely you have some ^M characters within the script  which may have come from either editing the script using Windows editor,  uploading the script using the datastore browser OR using wget. The  best option is to either using WinSCP on Windows to upload the script  and edit using vi editor on ESX(i) host OR Linux/UNIX scp to copy the  script into the host. If you still continue to have the issue, do a  search online on various methods of removing this Windows return  carriage from the script

19Q: My backup works fine OR it works for a single backup but I get an error message  “Input/output error” or “-ash: YYYY-MM-DD: not found” during the snapshot removal process. What is this?
19A: The issue has been recently identified by few users as a problem with user’s NFS server in which it reports an error when deleting large files that take longer than 10seconds. VMware has recently released a KB articlehttp://kb.vmware.com/kb/1035332 explaining the details and starting with vSphere 4.1 Update 2 or vSphere 5.0, a new advanced ESX(i) parameter has been introduced to increase the timeout. This has resolved the problem for several users and maybe something to consider if you are running into this issue, specifically with NFS based backups.

20Q: Will this script function with vCenter and DRS enabled?
20Q: No, if the ESX(i) hosts are in a DRS enabled cluster, VMs  that are to be backed up could potentially be backed up twice or never  get backed up. The script is executed on a per host basis and one would  need to come up a way of tracking backups on all hosts and perhaps write  out to external file to ensure that all VMs are backed up. The main use  case for this script are for standalone ESX(i) host

21Q: I’m trying to use WinSCP to manually copy VM files but it’s very slow or never completes on huge files, why is that?
21A: WinSCP was not designed for copying VM files out of your  ESX(i) host, take a look at Veeam’s FastSCP which is designed for moving  VM files and is a free utility.

22Q: Can I use setup NFS Server using Windows Services for UNIX (WSFU) and will it work?
22A: I’ve only heard a handful of users that have successfully  implemented WSFU and got it working, YMMV. VMware also has a KB article  decribing the setup process here: http://kb.vmware.com/kb/1004490 for those that are interested. Here is a thread on a user’s experience between Windows Vs. Linux NFS that maybe helpful.

23Q: How do VMware Snapshots work?
23A: http://kb.vmware.com/kb/1015180

24Q: What files make up a Virtual Machine?
24A: http://virtualisedreality.wordpress.com/2009/09/16/quick-reminder-of-what-files-make-up-a-virtual-machine/

25Q: I’m having some issues restoring a compressed VM backup?
25A: There is a limitation in the size of the VM for compression  under ESXi 3.x & 4.x, this limitation is in the unsupported Busybox  console and should not affect classic ESX 3.x/4.x. On ESXi 3.x,  the maximum largest supported VM is 4GB for compression and on ESXi 4.x  the largest supported VM is 8GB. If you try to compress a larger VM, you  may run into issues when trying to extract upon a restore. PLEASE TEST THE RESTORE PROCESS BEFORE MOVING TO PRODUCTION SYSTEMS!

26Q: I’m backing up my VM as “thin” format but I’m still not noticing any size reduction in the backup? What gives?
2bA: Please refer to this blog post which explains what’s going on: http://www.yellow-bricks.com/2009/07/31/storage-vmotion-and-moving-to-a-thin-provisioned-disk/

27Q: I’ve enabled VM_SNAPSHOT_MEMORY and when I restore my VM it’s still offline, I thought this would keep it’s memory state?
27A: VM_SNAPSHOT_MEMORY is only used to ensure when the  snapshot is taken, it’s memory contents are also captured. This is only  relavent to the actual snapshot itself and it’s not used in any  shape/way/form in regards to the backup. All backups taken whether your  VM is running or offline will result in an offline VM backup when you  restore. This was originally added for debugging purposes and in  generally should be left disabled

28Q: Can I rename the directories and the VMs after a VM has been backed up?
28A: The answer yes, you can … but you may run into all sorts  of issues which may break the backup process. The script expects a  certain layout and specific naming scheme for it to maintain the proper  rotation count. If you need to move or rename a VM, please take it out  of the directory and place it in another location

29Q: Can ghettoVCB support CBT (Change Block Tracking)?
29A: No, that is a functionality of the vSphere API + VDDK API (vSphere Disk Development Kit). You will need to look at paid solutions such as VMware vDR, Veeam Backup & Recovery, PHD Virtual Backups, etc. to leverage that functionailty.

 

30Q: Does ghettoVCB support rsync backups?
30A: Currently ghettoVCB does not support rsync backups, you either obtain or compile your own static rsync binary and run on ESXi, but this is an unsupported configuration. You may take a look at this blog post for some details.

 

31Q: How can I contribute back?

31A: You can provide feedback/comments on the ghettoVCB Group. If you have found this script to be useful and would like to contribute back, please click here to donate.

 

32Q: How can select individual VMDKs to backup from a VM?

32A: Ideally you would use the “-c” option which requires you to create individual VM configuration file, this is where you would select specific VMDKs to backup. Note, that if you do not need to define all properties, anything not defined will adhere from the default global properties whether you’re editing the ghettoVCB.sh script or using ghettoVCB global configuration file. It is not recommended that you edit the ghettoVCB.sh script and modify the VMDK_FILES_TO_BACKUPvariable, but if you would like to keep everything in one script, you may add the extensive list of VMDKs to backup but do know this can get error prone as script may be edited frequently and lose some flexibility to support multiple environments.

 

33Q: Why is email not working when I’m using ESXi 5.x but it worked in ESXi 4.x?

33A: ESXi 5.x has implemented a new firewall which requires the email port that is being used to be opened. Please refer to the following articles on creating a custom firewall rule for email:

http://www.virtuallyghetto.com/2012/09/creating-custom-vibs-for-esxi-50-51.html

How to Create Custom Firewall Rules in ESXi 50

How to Persist Configuration Changes in ESXi 4.x/5.x Part 1

How to Persist Configuration Changes in ESXi 4.x/5.x Part 2

 

34Q: How do I stop the ghettoVCB process?

34A: Take a look at the Stopping ghettoVCB Process section of the documentation for more details.

 


 

Our NFS Server Configuration

Many have asked what is the best configuration and recommendation for  setting up a cheap NFS Server to run backups for VMs. This has been a  question we’ve tried to stay away from just because the possiblities and  solutions are endless. One can go with physical vs. virtual, use VSA  (Virtual Storage Appliances) such as OpenFiler or Lefthand Networks,  Windows vs. Linux/UNIX. We’ve not personally tested and verify all these  solutions and it all comes down to “it depends” type of answer. Though  from our experience, we’ve had much better success with a physical  server than a virtual.

It is also well known that some users are experiencing backup issues  when running specifically against NFS, primarily around the rotation and  purging of previous backups. The theory from what we can tell by  talking to various users is that when the rotation is occuring, the  request to delete the file(s) may take awhile and does not return within  a certain time frame and causes the script to error out with unexpected  messages. Though the backups were successful, it will cause unexpected  results with directory structures on the NFS target. We’ve not been able  to isolate why this is occuring and maybe due to NFS  configuration/exports or hardware or connection not being able to  support this process.

We’ll continue to help where we can in diagonising this issus but we  wanted to share our current NFS configuration, perhaps it may help some  users who are new or trying to setup their system. ( Disclaimer: These configurations are not recommendations nor endorsement for any of the components being used)

UPDATE: Please also read FAQ #19 for details + resolution

Server Type: Physical
Model: HP DL320 G2
OS: Arch linux 2.6.28
Disks: 2 x 1.5TB
RAID: Software RAID1
Source Host Backups: ESX 3.5u4 and ESX 4.0u1 (We don’t run any ESXi hosts)

uname -a output

Linux XXXXX.XXXXX.ucsb.edu 2.6.28-ARCH #1 SMP PREEMPT Sun Jan 18 20:17:17 UTC 2009 i686 Intel(R) Pentium(R) 4 CPU 3.06GHz GenuineIntel GNU/Linux

NICs:

00:05.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5702X Gigabit Ethernet (rev 02)
00:06.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5702X Gigabit Ethernet (rev 02)

NFS Export Options:

/exports/vm-backups XXX.XXX.XXX.XXX/24(rw,async,all_squash,anonuid=99,anongid=99)

 

*One important thing to check is to verify that your NFS exportion options are setup correctly, “async” should be configured to ensure that all IO requests are processed and  reply back to the client before waiting for the data to be written to  the storage.

*Recently VMware released a KB article describing the various “Advanced NFS Options” and their meanings and recommendations: http://kb.vmware.com/kb/1007909 We’ve not personally had to touch any of these, but for other vendors  such as EMC and NetApp, there are some best practices around configuring  some of these values depending on the number of NFS volumes or number  of ESX(i) host connecting to a volume. You may want to take a look to  see if any of these options may help with NFS issue that some are seeing

*Users should also try to look at their ESX(i) host logs during the time  interval when they’re noticing these issues and see if they can find  any correlation along with monitoring the performance on their NFS  Server.

*Lastly, there are probably other things that can be done to improve NFS  performance or further optimization, a simple search online will also  yield many resources.


 

Useful Links:

Windows utility to email ghettoVCB Backup Logs – http://www.waldrondigital.com/2010/05/11/ghettovcb-e-mail-rotate-logs-batch-file-for-vmware/
Windows front-end utility to ghettoVCB –  http://www.magikmon.com/mkbackup/ghettovcb.en.html

Note: Neither of these tools are supported, for questions or comments regarding these utilities please refer to the author’s pages.

 


 

Change log:

01/13/13 –

 

Enhancements:

  • ghettoVCB & ghettoVCB-restore supports ESXi 5.1
  • Support for individual VM backup via command-line and added new -m flag
  • Support VM(s) with existing snapshots and added new configuration variable calledALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP
  • Support multiple running instances of ghettoVCB running and added a new -w flag
  • Configure VM shutdown/startup order and added two new configuration variables called VM_SHUTDOWN_ORDERand VM_STARTUP_ORDER
  • Support changing custom VM name during restore
  • Documentation updates

Fixes:

  • Fixed tab/indentation for both ghettoVCB/ghettoVCB-restore
  • Temp email files and email headers
  • Fixed “whoami” command as it is no longer valid in ESXi 5.1 to check for proper user
  • Added 2gbsparse check in sanity method to auto-load VMkernel module
  • Various typos, for greater detail, you can refer to the “diff” in github repo

 

—————————————————————————————————————————————————————————————————————————

11/19/11 –

 

Enhancements:

  • ghettoVCB & ghettoVCB-restore is now packaged together and both scripts are versioned on github
  • ESXi 5 firewall check for email port (Check FAQ #33 for more details)
  • New EMAIL_DELAY_INTERVAL netcat variable to control slow SMTP servers
  • ADAPTER_TYPE (buslogic,lsilogic,ide) no longer need to manually specified, script will auto-detect based on VMDK descriptor file
  • Using symlink -f parameter for quicker unlink/re-link for RSYNC use case
  • Updated documentation, including NFS issues (Check FAQ #19 for more details including new VMware KB article)

Fixes:

  • vSphere 4.1 Update 2 introduced new vim-cmd snapshot.remove param, this has now been updated in script to detect this new param change

 

—————————————————————————————————————————————————————————————————————————

06/28/11 –

Enhancements:

  • Support for vSphere 5.0 – ESXi 5.0

 

—————————————————————————————————————————————————————————————————————————

05/22/11 –

Enhancements:

 

  • Support for multiple email recipients
  • Support for individual VMDK backup within ghettoVCB.sh script – FAQ #33

 

Fixes:

  • Minor fix in additional validation prior to VM rotation

 


03/14/11 –

 

Enhancements:

  • Enhanced “dryrun” details including configuration and/or VMDK(s) issues
    • Warning messages about physical RDM and Independent VMDK(s)
    • Warning messages about VMs with snapshots
  • New storage debugging details
    • Datastore details both pre and post backups
    • Datstore blocksize miss-match warnings
  • Quick email status summary is now included in the title of the email, this allows a user to quickly verify whether a backup was successful or had complete/partial failure without having to go through the logs.
  • Updated ghettoVCB documentation
  • ghettoVCB going forward will now be version tracked via github and previous releases will not be available for download

Fixes:

  • Updated absolute sym link path for RSYNC_LINK variable to relative path
  • Enhanced logging and details on warning/error messages

 

Big thanks to Alain Spineux and his contributions to the ghettoVCB script and helping with debugging and testing.

 


09/28/10 –

Enhancements:

 

  • Additional email support for Microsoft IIS and email debugging functionality (Experimental Support)
  • ghettoVCB PID is now captured in the logs
  • Rsync support, please take a look at the above documentation for Rsync Support (Experimental Support)

Fixes:

 

  • Fixed a few typos in the script
  • Trapping SIG 13

 

 


 

07/27/10 –

Enhancements:

 

  • Support for emailing backup logs (Experimental Support)

 

 


 

07/20/10 –

Enhancements:

 

  • Support for vSphere 4.1 (ESX and ESXi)
  • Additional logging information for debugging purposes

 

 


 

05/12/10 –

Enhancements:

 

  • Thanks to user Rodder who submitted a patch for a workaround  to handle the NFS I/O issue. The script will check to see if the return  code of the “rm” operation for VMs that are to be rotated. If the return  code has not returned right away, we may be running into the NFS I/O  issue, the script will not sleep and check perodically to see if NFS  volume is responsive and then continue to the next VM for backup.

Fixes:

 

  • Resolved the problem when trying to specify ghettoVCB global configuration file with the fullpath

 

 


 

05/11/10 –

 

 

  • Updated useful links to 2 utilties that were written by users for ghettoVCB

 

 


 

05/05/10 –

Fixes:

 

  • Resolved an issue where VMs with spaces were not being properly rotated. Thanks to user chrb for finding the bug

 

 


 

04/24/10 –

Enhancements:

 

  • Added the ability to include an exclusion list of VMs to not backup

Fixes:

 

  • Resolved persistent NFS configuration bug due to the addition of the global ghettoVCB conf

 

 


 

04/23/10 –

Fixes:

 

  • Resolved a bug in the VM naming directory which may not delete backups properly

 

 


 

04/20/10 –

 

 

  • Support for global ghettoVCB configuration file. Users no longer  need to edit main script and can use multiple configuration files based  on certain environment configurations
  • Ability to backup all VMs residing on a specific host w/o specifying VM list
  • Implemented simple locking mechenism to ensure only 1 instance of ghettoVCB is running per host
  • Updated backup directory structure – rsync friendly. All backup VM  directories will now have the format of “VMNAME-YYYY-MM-DD_HH_MM_SS”  which will not change once the backup has been completed. The script  will keep N-copies and purge older backups based on the configurations  set by the user.
  • Additional logging and final status output has been added to the  script to provide more useful error/warning messages and an additoinal  status will be printed out at the end of each backup to provide an  overall report

Big thanks goes out to the community for the suggested features and to those that submitted snippet of their modifications.


 

03/27/10 –

 

  • Updated FAQ #0-1 & #25-29 for common issues/questions.
  • For those experiencing NFS issue, please take a look at FAQ #29
  • Re-packaged ghettoVCB.sh script within a tarball (ghettoVCB.tar.gz)  to help assist those users having the “Windows affect” when trying to  execute the script

 


 

02/13/10 –

Updated FAQ #20-24 for common issues/questions.      Also included a new section about our “personal” NFS configuration and setup.


 

01/31/10 –

Fix the crontab section to reflect the correct syntax + updated FAQ #17,#18 and #19 for common issues.


 

11/17/09 –

The following enhancements and fixes have been implemented in this  release of ghettoVCB. Special thanks goes out to all the ghettoVCB BETA  testers for providing time and their environments to test features/fixes  of the new script!

Enhancements:

 

  • Individual VM backup policy
  • Include/exclude specific VMDK(s)
  • Logging to file
  • Timeout variables
  • Configur snapshot memory/quiesce
  • Adapter format
  • Additional logging + dryrun mode
  • Support for both physical/virtual RDMs

Fixes:

  • Independent disk awareE

LuManager开启探针读取内存等数据

前两天,有网友遇到同样的问题,现在解决了,特记录下来,让后来者参考。

因为跨目录访问了,需要设置一个cgi端口,这个端口在 左上角 网站(虚拟主机) –> FastCGI端口 ( 请填写9000-20000之间的数字 )那里设置,只有商业授权版才有。

LUM后台 –> 配置与优化 –> 修改配置文件

/usr/local/php_fcgi/lib/php.ini: FastCGI模式的PHP配置文件

open_basedir = "/proc:/home:/tmp:/var/tmp"

在LUM 2.0.68版测试通过。

多谢洞哥的指导,谢谢。

解决无法访问windows installer服务

在 Windows XP 中安装程序时出现“The Windows Installer Service Could Not Be Accessed”(无法访问 Windows Installer 服务)错误消息
要解决此问题,请按照下列步骤操作:
方法一:
卸载,重新安装windows installer服务
一、先用dos命令窗口msiexec /unregserver 停掉windows installer服务。
二、下载InstMsiW.exe,用winrar解压开。进入目录。

下载: INSTMSIW.EXE

三、右击msi.inf ,点击安装,右击mspatcha.inf ,点击安装。
四、再用dos命令窗口msiexec.exe /regserver 启用服务。
方法二:
1.如果曾安装过ACDSee5.0(包括迷你中文版),卸载它。如果还不行就重装Windows
Installer 或者ACDSee 4.0

下载: WindowsInstaller-KB893803-v2-x86.exe

2.运行cmd,然后运行sfc/scannow检查系统文件
3.运行Services.msc,把Windows Installer 服务设置为手动运行,然后重新运行
4.打开任务管理器,找到并结束ikernel.exe进程,重新安装
5.禁用杀毒软件的实时防护
6.删除 C:\Program Files\Common Files\InstallShield\Engine\6\Intel 32这个文
件夹中的所有文件,然后重启动电脑,重新运行安装程序
方法三:
这是由于一些软件制作的问题导致windows installer不能正常工作
恢复步骤如下:
1.再次安装windows installer2.0,运行instmsiw.exe
如果说”服务已经安装”然后直接退出安装就再跟着做,否则你重装就OK了!
2.删除注册表中的[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer]
然后运行instmsiw.exe
3.绝招:
(1) 删除msiserver 服务
运行regedit,删除下面的MSIServer 服务
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer]
把下面的内容存为unmsiserver.reg 文件,然后双击左键,把它合并进注册表中

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;unmsiserver.reg
    Windows Registry Editor Version 5.00
    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer]
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  

(2) 删除msi 的文件
用下面的脚本存为一个unmsi.inf文件,然后在inf文件上右键单击install,就会删除一些msi的dll,这时windows 的 sfc机制可能警告一些系统文件被修改要求插入win2k的光盘,不理睬它。这个脚本是我从instmsiw.exe中修改得来的。

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;unmsi.inf
    ;;;;;;;;;;;;;;;;;
    [Version]
    signature = "$Windows NT$"
    Class = %ExceptionClassDesc%
    ClassGUID = {F5776D81-AE53-4935-8E84-B0B283D8BCEF}
    Provider = %Microsoft%
    CatalogFile = msi.cat
    ComponentId = {2E742517-5D48-4DBD-BF93-48FDCF36E634} ; GUID assigned to the Windows Installer
    DriverVer=03-13-2001, 2.0.2460.1
    [SourceDisksNames]
    1 = %msi_media%
    [SourceDisksFiles]
    msi.dll = 1
    msihnd.dll = 1
    msimsg.dll = 1
    msiexec.exe = 1
    msisip.dll = 1
    [DestinationDirs]
    Msi.SystemFiles = 11 ; %windir%\system32
    Msi.DllCacheFiles = 11,dllcache ; %windir%\system32\dllcache
    [DefaultInstall]
    DelFiles = Msi.SystemFiles,Msi.DllCacheFiles
    ;
    ; COPYFLG_REPLACE_BOOT_FILE flag (0x1000) not necessary for
    ; files in the dllcache
    ;
    [Msi.DllCacheFiles]
    msi.dll
    msihnd.dll
    msimsg.dll
    msiexec.exe
    msisip.dll
    [Msi.SystemFiles]
    msi.dll
    msihnd.dll
    msimsg.dll
    msiexec.exe
    msisip.dll
    [Strings]
    Microsoft = "Microsoft Corporation"
    msi_media = "Microsoft Windows Installer Distribution Media"
    ExceptionClassDesc = "Microsoft Windows Installer"
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  

(3) 重新启动,按F8键,进入带命令行的安全模式,执行下面的命令

    regsvr32 /u %windir%\msi.dll
    del %windir%\msi.dll
  

(4) 重启动,运行instmsiw.exe,安装windows installer ,一切正常了。
以管理员身份登录到计算机。
单击“开始”,然后单击“运行”。
在“打开”框中,键入 cmd,然后单击“确定”。
在命令提示符下,键入 msiexec.exe /unregister,然后按 Enter。
键入 msiexec /regserver,然后按 Enter。
验证 SYSTEM 帐户对 Windows 注册表中的 HKEY_CLASSES_ROOT 配置单元具有完全控制访问权限。在某些情况下,也可能需要添加管理员帐户。为此,请按照下列步骤操作:警告:如果使用注册表编辑器或其他方法错误地修改了注册表,则可能导致严重问题。这些问题可能需要重新安装操作系统才能解决。Microsoft 不能保证您可以解决这些问题。修改注册表需要您自担风险。
单击“开始”,单击“运行”,在“打开”框中键入 regedit,然后单击“确定”。
单击以下注册表配置单元:
HKEY_CLASSES_ROOT
在“编辑”菜单上,单击“权限”。
如果“SYSTEM”没有在“组或用户名”列表中列出,请单击“添加”,确保本地计算机名称出现在“查找位置”框中,在“输入对象名称来选择”框中键入 system,单击“检查名称”,然后单击“确定”。
在“组或用户名”列表中单击“SYSTEM”,然后选中“SYSTEM 权限”框中“允许”下的“完全控制”复选框。
单击“应用”,然后单击“确定”退出注册表编辑器。
重新启动计算机。