如何在script中確定mount有成功 - Linux

By Iris
at 2015-05-17T17:09
at 2015-05-17T17:09
Table of Contents
我有一個備份的指令,要在特定的分割區執行,所以第一步要確定mount。
雖然每次上線的的順序可能變掉,我可以用UUID解決這問題,然後我想到
用grep看mount有沒有備份資料夾的文字來確定mount有沒有成功:
test -n `mount|grep --color "on /backup type ext4"`
來看有沒有mount只會得到
-bash: test: 太多引數
這樣,看來test不能這樣玩。
所以我想請問有沒有辦法在script中檢查【特定的分割區mount到特定的位置】?
--
因為「其實呢,這場戰爭結束後,我就要回老家結婚了。」
而死亡的角色,據研究指出,背後的傷勢比前面還嚴重。
民明書房─《死亡FLAG──你不可不知的真實》
--
雖然每次上線的的順序可能變掉,我可以用UUID解決這問題,然後我想到
用grep看mount有沒有備份資料夾的文字來確定mount有沒有成功:
test -n `mount|grep --color "on /backup type ext4"`
來看有沒有mount只會得到
-bash: test: 太多引數
這樣,看來test不能這樣玩。
所以我想請問有沒有辦法在script中檢查【特定的分割區mount到特定的位置】?
--
因為「其實呢,這場戰爭結束後,我就要回老家結婚了。」
而死亡的角色,據研究指出,背後的傷勢比前面還嚴重。
民明書房─《死亡FLAG──你不可不知的真實》
--
Tags:
Linux
All Comments

By Mary
at 2015-05-21T22:02
at 2015-05-21T22:02

By Ursula
at 2015-05-24T17:36
at 2015-05-24T17:36

By Suhail Hany
at 2015-05-27T09:01
at 2015-05-27T09:01

By Andy
at 2015-05-31T20:34
at 2015-05-31T20:34

By Carolina Franco
at 2015-06-01T05:26
at 2015-06-01T05:26

By Tristan Cohan
at 2015-06-03T02:41
at 2015-06-03T02:41
Related Posts
要如何改lsusb連結的硬體資訊?

By David
at 2015-05-16T02:52
at 2015-05-16T02:52
Postfix自動轉信rule

By Madame
at 2015-05-15T21:18
at 2015-05-15T21:18
Ubuntu php5 source to deb

By Lauren
at 2015-05-15T16:26
at 2015-05-15T16:26
關於 nginx 自動 urldecode問題

By Sandy
at 2015-05-15T00:39
at 2015-05-15T00:39
ubuntu 14.04 samba server的問題

By Joseph
at 2015-05-14T21:20
at 2015-05-14T21:20