HackMD
    • Sharing Link copied
    • /edit
    • View mode
      • Edit mode
      • View mode
      • Book mode
      • Slide mode
      Edit mode View mode Book mode Slide mode
    • Note Permission
    • Read
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Write
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • More (Comment, Invitee)
    • Publishing
    • Commenting Enable
      Disabled Forbidden Owners Signed-in users Everyone
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Invitee
    • No invitee
    • Options
    • Versions
    • Transfer ownership
    • Delete this note
    • Template
    • Save as template
    • Insert from template
    • Export
    • Google Drive Export to Google Drive
    • Gist
    • Import
    • Google Drive Import from Google Drive
    • Gist
    • Clipboard
    • Download
    • Markdown
    • HTML
    • Raw HTML
Menu Sharing Help
Menu
Options
Versions Transfer ownership Delete this note
Export
Google Drive Export to Google Drive Gist
Import
Google Drive Import from Google Drive Gist Clipboard
Download
Markdown HTML Raw HTML
Back
Sharing
Sharing Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
More (Comment, Invitee)
Publishing
More (Comment, Invitee)
Commenting Enable
Disabled Forbidden Owners Signed-in users Everyone
Permission
Owners
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Invitee
No invitee
   owned this note    owned this note      
Published Linked with
Like BookmarkBookmarked
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- tags: 0archive --- # 0archive 儲存空間處理方式 我記得之前 pm5 說的主要要處理兩件事,一個是確認已經有順利備份到了 s3 ,然後再來才是砍掉舊資料 > [name=chihao] 如果這週(6/28 拜一到 7/4 拜日)大家有空來同步的話⋯ > chihao 可以的時間:三、四、五晚上、週日下午 > [name=wenyi] 這週週三、四 晚上都 ok 或 周日下午 > [name=pm5] 台灣時間拜三拜四晚上 ok ## 2021-07-08 - 怎麼確認什麼資料可以刪 - partition 總共只有 12 個 - 刪除舊資料不要拖過一年 XD 不然新舊資料會出現在同一個 partition - 抓下來的 Snapshot 都有送進 S3 就可以刪了 - 通常超過三四個月以上的舊資料才會刪 - 每次硬碟不夠大概刪 2-3 個月就可以回到 70% 以下 - 目前是 Ronny 有喊才會刪 xd - S3 - 怎麼看上面的資料 - 其實是 Linode XD - 其實是公開的,但網址沒有公開 XD - http://us-east-1.linodeobjects.com/0archive/user_tainan-sun-500796/ArticleSnapshot20200622.jsonl.bz2 - 每天會把當天所有 snapshot 壓縮上傳,上傳到 s3 後手動更新 [gsheet](https://docs.google.com/spreadsheets/d/12r5zuchGa76PVqWKZe1zrLexjqCncFODIsZIUga2krg/edit#gid=0) - 已經一陣子沒更新了 - 怎麼傳上去 - S3 credentials: [0archive gdrive](https://drive.google.com/drive/u/0/folders/18uDOhXBoxuiA0gyEy4U-i0ccpN-DN0bN) / team-only / Credentials - 把 credential 存成 ~/.s3cfg 以後,用 s3cmd 上傳 - ZeroScraper 裡的 scripts/upload-mysqldump.sh 就是在做上傳這件事,middle2 的 cronjob 會每日跑一次 - 會傳但不會自動更新 [gsheet](https://docs.google.com/spreadsheets/d/12r5zuchGa76PVqWKZe1zrLexjqCncFODIsZIUga2krg/edit#gid=0) XD - 我們可以在 local 用 `s3cmd ls 's3://0archive/user_tainan-sun-500796/ArticleSnapshot202101*'` - try try `| grep ArticleSnapshot202101` - 可以用 `s3cmd` 看檔案列表,就應該不需要再手動維護這個 [gsheet](https://docs.google.com/spreadsheets/d/12r5zuchGa76PVqWKZe1zrLexjqCncFODIsZIUga2krg/edit#gid=0) 了 - 怎麼刪資料 [過期 Snapshot 刪除](https://g0v.hackmd.io/lMQO37z6SbWNWo3R4-X_EA#%E9%81%8E%E6%9C%9F-Snapshot-%E5%88%AA%E9%99%A4),從 Step 4 開始 - pm5: 看最舊 2 個月有沒有進 s3,有就砍 partition - 之前會看有沒有 parse - 看 parser log - 對 google drive 裡面有沒有 - 這個方式不太可靠 XD - 比較可靠:mysql 建 queue 追蹤每個 snapshot parsing 的狀況??? - 很久以前的 todo XD - 怎麼看 「最舊」? - https://middle2.com/phpMyAdmin/sql.php?db=user_tainan-sun-500796&table=ArticleSnapshot&pos=0 - ArticleSnapshot table - 目前(2021/7/8 最舊 snapshot = 1/1) - 可以查 `SELECT FROM_UNIXTIME(MIN(snapshot_at)) FROM ArticleSnapshot WHERE 1` ### 清理空間下一步? 1. [最簡單] 寫一個 command 做上面的所有事 2. [最理想] 能夠在 db 上面看得出來是不是每一個 snapshot 都 parsed 好了, 沒有錯誤訊息 有沒有在用? IORG = 每週 上傳 gdrive? ArticleParser script service acct - pm5 svc acct 滿了 - 換成 wenyi (ntu) svc acct 但無法 overwrite pm5 的檔案 - 目前作法:無法 overwrite 的檔案直接 pass XD - 有嘗試轉移 ownership 但沒有成功 - 很頻繁嗎? public dataset 的 gcp project + 舊 svc acct 在 pm5 那裡 XD project + wenyi + chihao ### 轉移公開資料集到其他地方? - ~~維持現狀~~ - ~~GitHub~~ - 需要開 LFS - Github 會把違反版權的東西拿下來,我們是部分內文不知道會不會被拿下來 - 煩:每天要上傳新檔案時要把所有檔案 pull 下來 [崩~~潰~~~~] - Linode S3 - $5 250G - $0.02 +1G ### 轉移全文資料集? - ~~維持現狀~~ - 跟公開資料集有一樣的狀況 - ~~GitHub~~ - Linode S3 暫存 + 下載保存 ### Action Items - [ ] 手動刪除 2021/1-3 partition - [ ] 寫一個清理空間精靈 XD script 自動做上面的所有事 - [ ] 開 2 個 Linode S3 - [ ] 改上傳公開資料集 script => S31 - [ ] 改上傳全文資料集的 script => S32 ### 空間精靈 pseudo code --- - 把 0archive 調整為各種型態的 archive 為目的的專案如何?不是只有産出 dataset 為目的,我覺得使用 Internet Archive 這些 know-how 與 archive 相關技術也可以納入 - 是不是要來找接下來的經費了?

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lost their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.


Upgrade

All
  • All
  • Team
No template.

Create a template


Upgrade

Delete template

Do you really want to delete this template?

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

Sign in via GitHub

New to HackMD? Sign up

Help

  • English
  • 中文
  • 日本語

Documents

Tutorials

Book Mode Tutorial

Slide Example

YAML Metadata

Resources

Releases

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions

Versions

Upgrade now

Version named by    

More Less
  • Edit
  • Delete

Note content is identical to the latest version.
Compare with
    Choose a version
    No search result
    Version not found

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.