Groups
Groups
Sign in
Groups
Groups
NYCU NASA 課程討論區
Conversations
About
Send feedback
Help
zfsbak export問題
241 views
Skip to first unread message
李宜蓁
unread,
Nov 9, 2024, 2:15:41 AM
11/9/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NYCU NASA 課程討論區
助教好:
我在本地端執行 "sudo -E zfsbak -e mypool/public 1" 時可以運作:
但是 judge 會出現以下錯誤:
想請問可能出了什麼問題,謝謝助教
潘仰祐
unread,
Nov 9, 2024, 1:15:08 PM
11/9/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NYCU NASA 課程討論區
我不是助教但,我在做這一題的時候,發現 judge 不一定會用 `sudo -E` 來執行 `zfsbak -e ...`。所以你可以
從 `man sudo` 的 Environment 一段,找到判段誰觸發了 `sudo` 的方法
然後你可以在 Google 上搜尋 Get home directory by username,找到在 Shell Script 中把 Username 對應到該使用者的 Home Directory 的方法
最後,你在輸出檔案的時候,要放到真正觸發了 sudo 的使用者的資料夾(而不是直接放入 $HOME)
經過這幾點,我的 script 就可以通過 judge 了。希望這對你有幫助 OwOb
yvonne04...@nycu.edu.tw
在 2024年11月9日 星期六下午3:15:41 [UTC+8] 的信中寫道:
孫奇霆(112950026)
unread,
Nov 9, 2024, 1:42:38 PM
11/9/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NYCU NASA 課程討論區
借板問:如果助教不用sudo -E,那密碼那個變數要如何傳進來?
我有寫判斷變數存不存在的條件,所以judge時都會退出說該變數不存在…
當然如果助教能在export和import都加入sudo -E就好了
kevinp...@nycu.edu.tw
在 2024年11月10日 星期日凌晨2:15:08 [UTC+8] 的信中寫道:
呂耀承
unread,
Nov 10, 2024, 8:02:57 AM
11/10/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NYCU NASA 課程討論區
同學你好:
這題在判斷時不會使用到 -E,但會直接以 sudo ZFSBAK_PASS="secure_password" zfsbak -e ... 的方式進行測試,在設定正確的情況下環境變數都應該被正常傳入。供同學們參考。
助教
suen333r...@nycu.edu.tw
在 2024年11月10日 星期日凌晨2:42:38 [UTC+8] 的信中寫道:
李宜蓁
unread,
Nov 10, 2024, 8:55:28 AM
11/10/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NYCU NASA 課程討論區
謝謝助教和同學
我後來將$HOME改成觸發sudo使用者的資料夾就過了
lyonlu...@nycu.edu.tw
在 2024年11月10日 星期日晚上9:02:57 [UTC+8] 的信中寫道:
孫奇霆(112950026)
unread,
Nov 10, 2024, 9:32:42 AM
11/10/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NYCU NASA 課程討論區
感謝助教和同學幫忙,我知道為什麼讀不到變數了
說明寫密碼的變數是EXPORT_PASS
但下面的範例是用ZFSBAK_PASS
可能是pdf有誤
yvonne04...@nycu.edu.tw
在 2024年11月10日 星期日晚上9:55:28 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages