Cov txheej txheem:

OrangeBOX: OrangePI Raws Li Kev Ruaj Ntseg Thauj Khoom: 5 Kauj Ruam
OrangeBOX: OrangePI Raws Li Kev Ruaj Ntseg Thauj Khoom: 5 Kauj Ruam

Video: OrangeBOX: OrangePI Raws Li Kev Ruaj Ntseg Thauj Khoom: 5 Kauj Ruam

Video: OrangeBOX: OrangePI Raws Li Kev Ruaj Ntseg Thauj Khoom: 5 Kauj Ruam
Video: Unboxing the orange box 2024, Hlis ntuj nqeg
Anonim
OrangeBOX: OrangePI Raws Li Kev Ruaj Ntseg Thauj Khoom
OrangeBOX: OrangePI Raws Li Kev Ruaj Ntseg Thauj Khoom
OrangeBOX: OrangePI Raws Li Kev Ruaj Ntseg Thauj Khoom
OrangeBOX: OrangePI Raws Li Kev Ruaj Ntseg Thauj Khoom

OrangeBOX yog ib qho tagnrho-hauv-ib lub chaw ntim khoom khaws cia rau ib lub server.

Koj lub server tuaj yeem kis tus kab mob, ua tsis zoo, so thiab tag nrho koj cov ntaub ntawv tseem muaj kev nyab xeeb ntawm OrangeBOX thiab leej twg tsis nyiam lub luag haujlwm tsis yooj yim sua xws li ntaus ntawv thaub qab dab tsi koj nyuam qhuav ntsaws thiab pom qhov qhia tau nce qib yam tsis ua dab tsi ntxiv (tsuas yog cia siab rau khawv koob) cov pa luam yeeb yuav tsis tawm thaum kawg:)).

OrangeBOX yog kuv thawj qhov haujlwm uas feem ntau yog software, tsis yog kho vajtse hack. Nws yog qhov pib tsim kev cai NAS nrog lub LCD txuas.

Kauj Ruam 1: Cov Khoom Kho Vajtse

Cov Khoom Kho Vajtse
Cov Khoom Kho Vajtse
Cov Khoom Kho Vajtse
Cov Khoom Kho Vajtse
Cov Khoom Kho Vajtse
Cov Khoom Kho Vajtse

Txiv kab ntxwv PI xoom yog qhov qhib tau ib lub computer nkaus xwb. Nws tuaj yeem khiav Android 4.4, Ubuntu, Debian. Nws siv AllWinner H2 SoC, thiab muaj 256MB/512MB DDR3 SDRAM (256MB version yog Standard version. Txiv kab ntxwv Pi Zero yog rau txhua tus neeg uas xav pib tsim nrog thev naus laus zis - tsis yog siv nws xwb. Nws yog qhov yooj yim, lom zem, muaj txiaj ntsig zoo uas koj tuaj yeem siv los pib tswj hwm lub ntiaj teb ib puag ncig koj (https://www.orangepi.org/orangepizero/). Yog li nws yog qhov tseeb rau peb cia mus nrog nws:)

  • Hlau/yas/ntoo thawv (Kuv tau siv lub qub Yamaha sab nraud cd-rw lub thawv)
  • Txiv kab ntxwv PI Xoom lossis zoo dua (GPIO pinout yuav hloov pauv yog tias koj siv lwm tus qauv)
  • 2x20 RGB LCD cov ntxaij vab tshaus
  • Ib qho SFF 3.5/ LFF 2.55 usb tsav
  • Sata -> usb adapter. Nco ntsoov tias thaum OrangePI tsis txwv qhov txwv qis tshaj ntawm qhov muaj peev xwm tshaj plaws tsav tab sis ntau USB-rau-SATA txuas hniav ua (2TB max). Txiv kab ntxwv PI Zero Kuv siv tsuas muaj ib qho nkaus xwb USB 2.0 chaw nres nkoj nrog kev hloov pauv tau zoo ntawm 28 MB/s max. Kuv tau xaiv USB3.0 (npaj rau kev hloov kho yav tom ntej) -> SATA choj (hom yuav tsis tau hais txog) thiab nws tau txwv qhov txwv yog li nws zoo dua los xaiv tus choj pov thawj los txhawb nqa cov tsav loj xws li JMicron JMS567 nti raws cov choj. Ua koj tus kheej kev tshawb fawb ua ntej yuav ib qho. Kuv tuaj yeem nyob nrog qhov nrawm thiab nyuaj tsav txwv los ntawm kev siv 2TB sata tsav hauv txoj haujlwm no (yog tias koj muab tso rau hauv cov tsav loj dua, nws yuav raug lees paub tab sis OS yuav tsuas pom thawj 2TB ntawm nws yog li ntawm qhov muaj peev xwm yuav yog poob).
  • 12V 2.5 A lossis siab dua amp adapter. Xam txog 500mA ib txwm siv rau OPI Zero thiab 1.5A ncov rau tus qauv LFF SATA tsav. Oversizing yeej tsis mob. Hauv kuv teeb tsa Yamaha psu (dab tsi tuaj yeem muab ntau dua tam sim no txaus ntawm ob qho 12+5V txoj kab) hmoov tsis tau tawg: (vim txheeb xyuas qhov hloov pauv tseem ceeb mus rau GND rau ib pliag yog li kuv yuav tsum tau lo rau hauv cov khoom siv tsis tu ncua, ntawm tsawg kawg nws ua lub thawv ob peb grams sib dua.
  • Buck converter DC-DC 12V-> 5V. Kuv siv tib lub khoos phis tawj me me ib yam li IronForge, ua haujlwm zoo kawg nkaus.

Yeem yeem

Yog tias koj txaus siab siv + 10 $ ces koj tuaj yeem tau txais Orange Pi Plus (https://www.armbian.com/orange-pi-one-plus/) uas yog daim ntawv foos zoo ib yam thiab tau txais koj Gbe thiab SATA3. Txog qhov no Libra PI cov xov hluav taws xob tuaj yeem siv tau: https://github.com/OrangePiLibra/WiringPi tab sis txij li GPIO pinout sib txawv nws tawm ntawm qhov kev sau ntawv no.

Koj kuj tseem tuaj yeem ua qhov no nrog txiv kab ntxwv PI Plus2 tshiab uas muaj SATA txuas thiab koj tuaj yeem hla kev siv sata-> usb hloov tag nrho ua ke nrog lawv cov kev txwv. Yog tias koj npaj yuav siv FreeBSD lossis lwm yam BSDs Txiv kab ntxwv PI series yuav tsis yog qhov kev xaiv zoo tshaj plaws vim tias lawv cov cuab yeej txhawb nqa tau txwv (piv txwv li koj yuav tsum siv USB lo rau khau raj). Txog BSDs nws yog cov lus qhia zoo tshaj plaws los siv Raspberry PI. Ob tus lej C rau LCD thiab txhua lub plhaub ntawv sau tau txav mus rau lwm lub tshuab UNIX.

Kauj Ruam 2: Tsim Kho Vajtse

Kho vajtse Tsim
Kho vajtse Tsim
Kho vajtse Tsim
Kho vajtse Tsim
Kho vajtse Tsim
Kho vajtse Tsim

Lub thawv Yamaha tsuas yog txaus los khaws txhua qhov no, nws yuav tsis muaj chaw txaus rau Orange PI PC lossis li niaj zaus Raspi form-factor board.

Ethernet tau raug coj tawm nrog tus txuas mus rau tom qab ntawm lub thawv. Nco ntsoov tias Txiv kab ntxwv PI xoom tsuas muaj 100mbit/s Ethernet interface yog tias koj xav tau nrawm dua koj yuav xav tau siv lwm lub rooj tsav xwm xws li Asus Tinkerboard/RPI3B+/Lwm Cov Qauv PI Txiv Kab Ntxwv.

Tsis raug PIN Tawm yog ib qho thiab tsuas yog yuam kev koj tuaj yeem ua hauv txoj haujlwm no yog li ntawd nws tsim nyog siv qee txoj cai ntawm tus ntiv tes xoo hauv paus ntsiab lus:

1, Ib txwm sim siv tib lub xov tooj cua los ntawm END mus rau END. Kuv kuv tus kheej ua tib yam "yuam kev" hauv qee qhov haujlwm uas kuv tsis ua, tsuas yog vim tias kuv tsis muaj tus txiv neej ntev txaus-txiv neej-txiv neej-poj niam/poj niam-poj niam cov xov tooj ntawm tes thiab kuv thaj 2 ua ke tsuas yog mus nrog lub voj voog. Yog tias koj tsis sau cov ntaub ntawv koj ua haujlwm no tuaj yeem ua rau mob taub hau ntau xyoo tom qab uas koj yuav tsum kho, hloov kho.

2, Thov qee qhov kub hnyiab rau cov txuas. Yog tias siv cov khoom siv arduino-starter style mm/mf/ff cables uas tsis yog cov kab saum toj kawg nkaus nws zoo heev (tshwj xeeb tshaj yog tias koj tsiv ncig/thauj lub cuab yeej) uas cov txuas txuas tau tawm. Yog tias koj paub tias nws yuav yog lub cuab yeej siv tau ntev (tej zaum siv tau kom txog thaum nws tawg?!) Ces nws zoo dua los thov me ntsis kub kub ob qho tib si ntawm OrangePI thiab LCD sab ntawm cov txuas txuas kom lawv ua ke. Qhov no tuaj yeem yooj yim yaj/khawb tawm tom qab yog tias xav tau.

3, OrangePI xoom xaim Xov xwm tsis zoo yog tias Txiv kab ntxwv PI pinout tsis zoo ib yam li Raspberry PI 0/1/2/3 thiab tseem muaj qhov sib txawv ntawm lwm cov qauv txiv kab ntxwv PI. Txoj hauv kev zoo tshaj yog mus ntsib lub tsev qiv ntawv thaiv (Orange PI Zero version). Cov duab yuav tsis meej pem me ntsis tab sis cov no yog qhov zoo tshaj plaws uas kuv pom tau. Ib qho yog daim iav 180 degree ntawm lwm qhov. Txawm hais tias CLI cov duab tsis yog duab yuav nyuaj rau nkag siab nws yog qhov ncaj tshaj plaws rau pem hauv ntej.

Koj ib txwm tuaj yeem sib txawv 2 qhov kawg ntawm lub qhov rooj los ntawm kev txiav txim siab ib qho kawg raws li POSITIVE kawg nrog (+3.3/+5V) thiab lwm yam raws li NEGATIVE kawg (ib qho GND) -> qhov no yog qhov kawg ntawm qhov txuas txuas mus rau ETHERNET chaw nres nkoj.

Los ntawm Wiring PI Zero lub rooj koj tsuas xav tau ib kab lus wPI tsis nco qab txog lwm tus zoo li lawv yuav tsis nyob ntawd.

Yog li piv txwv los txuas LCD_E 15 (uas yog wPI 15!) Thiab LCD_RS 16 (uas yog wPI 16!) Suav cov pins los ntawm POSITIVE kawg ntawm qhov txuas (yooj yim ua nrog tus cwj mem lossis tus ntsia hlau me me). Qhov ntawd yuav yog lub cev nqes mus 4 tus pin thiab 5 tus pin.

4, Pab pawg. Yog tias muaj peev xwm muab cov pins siv ib sab ntawm ib leeg (pawg lawv ua ke) ib txwm xaiv qhov ntawd, nws ua rau lawv muaj kev tuav ntawm ib leeg txawm tias tsis muaj qhov kub thiab tseem nyob hauv lwm qhov haujlwm thaum koj muaj 2x 4x 6x 6x molex txuas koj tuaj yeem ua tau tsuas yog ua kom zoo dua cov pins nyob ib sab. Nov yog qhov zoo tshaj plaws uas koj tuaj yeem ua tau yog pab pawg ntawm 2-3s (zoo tagnrho thaum siv khaws cov hlua jumper los ntawm PCs qub).

Pins siv rau OrangePI LCD Screen txuas:

// Siv WIRINGPI tus lej PIN

#define LCD_E 15 // Enable Pin #define LCD_RS 16 // Sau npe xaiv tus pin #define LCD_D4 5 // Data pin 4 #define LCD_D5 6 // Data pin 5 #define LCD_D6 10 // Data pin 6 #define LCD_D7 11 // Cov ntaub ntawv tus pin 7

Pins siv rau RGB backlight tswj

$ G sau 10

$ G sau 4 1 $ G sau 7 1

Txiv kab ntxwv PI xoom wPI pins 1, 4, 7. Tsuas yog khawv koob no LCD tuaj yeem ua piv rau tus qauv txhim kho xiav lossis kho lub teeb ntsuab ntsuab LCD uas koj muaj ib qho cathode uas yuav tsum tau rub mus rau GND tias nws muaj 3 rau 3 xim Liab, ntsuab thiab xiav. Los ntawm kev hloov ua ke ntawm ib qho twg yog tig rau ON koj tuaj yeem sib xyaw xim sib txawv los ntawm cov xim hauv paus no tab sis tsuas yog qhov siab kawg tsis muaj qhov ntxoov ntxoo vim tias koj tsis tuaj yeem tswj qhov ci ntawm cov xim (nws yog nyob lossis tawm).

Ntxiv cov xim sib xyaw: ntxiv liab rau ntsuab yields daj; ntxiv liab rau xiav yields magenta; ntxiv ntsuab rau xiav yields cyan; ntxiv tag nrho peb qhov xim thawj zaug ua ke ua rau dawb.

Kauj Ruam 3: Kev Ua Haujlwm

Operating System
Operating System

OrangeBOX khau looj plab hlaub thiab Armbian linux (raws Debian Stretch) 4.14.18-sunxi kernel nrog kev nyab xeeb firewalled ib puag ncig, txuas rau VPN thiab tos rau tej thaj chaw deb backup txib los ntawm tus neeg rau zaub mov.

Qauv tsim:

-Txhua luks raws disk encryption (lub cuab yeej nws tus kheej tsis muaj tus yuam sij rau qhib lub thaub qab tsav. Nws yuav raug theej ib ntus los ntawm cov neeg rau zaub mov nyob deb mus rau ram /dev /shm, tsav qhib thiab tus yuam sij raug tshem tawm. tsav tsheb kaw thiab OrangeBox tau kaw cia hauv 1 feeb.)

-Txhua cov lus txib thiab cov yuam sij raug xa los ntawm cov neeg rau zaub mov nyob deb (lub cuab yeej nws tus kheej tsuas muaj daim ntawv pov thawj vpn) nws tsis muaj ib qho nkag mus rau cov neeg rau zaub mov nyob deb txawm tias ssh los ntawm lub cuab yeej no raug thaiv

-Cov ntaub ntawv hauv cheeb tsam tsis-encrypted kom tuaj yeem khau raj tau tab sis tsis muaj ib yam muaj txiaj ntsig thiab vim tias VPN uplink raug txwv ntau ntawm lwm qhov kawg txawm tias ua tiav qhov poob ntawm lub cuab yeej tus neeg tawm tsam tsis tuaj yeem ua dab tsi

Rub tawm Armbian Stretch los ntawm

Tau txais qhov system thiab khiav:

apt-tau hloov tshiab && apt-tau upgrade

apt-tau nruab sysvinit-core sysvinit-utils

Kho qhov /etc /inittab, txhua lub console tuaj yeem xiam vim lub npov yuav raug siv ua lub taub hau. Tawm tswv yim tawm hauv qab no:

#1: 2345: respawn:/sbin/getty 38400 tty1

#2: 23: respawn:/sbin/getty 38400 tty2 #3: 23: respawn:/sbin/getty 38400 tty3 #4: 23: respawn:/sbin/getty 38400 tty4 #5: 23: respawn:/sbin/getty 38400 tty5 #6: 23: respawn:/sbin/getty 38400 tty6

Rov pib koj lub thawv thiab tshem tawm systemd kom muaj qhov qhib tiag tiag bloatware dawb system.

apt-tau tshem --purge --auto-tshem systemd

Nruab ib co pob khoom

apt-tau nruab cryptsetup vim htop rsync screen gcc ua git

Nruab ib lub tsev qiv ntawv wiringpi

cd /usr /src

git clone https://github.com/xpertsavenue/WiringOP-Zero.git cd WiringOP-Zero chmod +x./build./build

Tsim cov neeg siv txiv kab ntxwv rau lub lcd zaub

groupadd -g 1000 txiv kab ntxwv

useradd -m -d /tsev /txiv kab ntxwv -s /rau hauv /bash -u 1000 -g txiv kab ntxwv txiv kab ntxwv

Tus saib xyuas uas tsis saib xyuas koj

apt-tau nruab watchdog

Saib ntawm/etc/default/watchdog # Pib watchdog ntawm lub sijhawm khau raj? 0 lossis 1 run_watchdog = 1 # Pib wd_keepalive tom qab siv ceev xwmphem? 0 lossis 1 run_wd_keepalive = 1 # Thauj khoom module ua ntej pib saib xyuas watchdog_module = "tsis muaj" # Qhia meej qhov kev xaiv saib xyuas ntxiv ntawm no (saib nplooj ntawv).

Saib ntawm /etc/watchdog.conf

# Tsawg kawg pab kom cov no

max-load-1 = 24 max-load-5 = 18 max-load-15 = 12

/etc/init.d/watchdog pib

Yuav tsum muaj tsawg kawg 1 xov xov thiab 1 txheej txheem:

hauv paus 42 0.0 0.0 0 0? Kuv <10:50 0:00 [watchdogd] hauv paus 14613 0.0 0.2 1432 1080? SLs 13:31 0:00/usr/sbin/saib xyuas

Kev Xeem:

Nco ntsoov tias koj tso tseg txhua yam thiab ua ib qho sync && sync && sync los sau cov ntaub ntawv tas mus rau lub disk. Tom qab ntawd yog qhov teeb meem hauv paus:

ncha 1> /dev /watchdog

Tom qab qee lub vib nas this lub tshuab yuav tsum rov pib dua.

Raws li phau ntawv qhia hais tias:

o Cov txheej txheem txheej txheem puas puv lawm?

o Puas muaj kev nco txaus? o Puas muaj kev faib khoom txaus? o Puas muaj qee cov ntaub ntawv siv tau? o Puas muaj qee cov ntaub ntawv hloov pauv nyob rau lub sijhawm muab? o Puas yog qhov haujlwm nruab nrab siab dhau? o Puas tau muaj cov ntaub ntawv rooj hla? o Puas yog txheej txheem tseem tab tom ua? Cov txheej txheem tau teev tseg los ntawm pid file. o Puas yog qee qhov chaw nyob IP teb rau ping? o Network cuam tshuam puas tau txais kev mus los? o Puas kub heev? (Cov ntaub ntawv ntsuas kub tsis tas yuav muaj.) O Ua tus neeg siv cov lus txib kom ua qhov kev xeem tsis raug cai. o Ua ib lossis ntau qhov kev sim/kho cov lus txib pom hauv /etc/watchdog.d. Cov lus txib no raug hu nrog kev sim sib cav lossis kho. Yog tias ib qho ntawm cov tshev no ua tsis tau zoo saib xyuas yuav ua rau raug kaw. Yuav tsum muaj ib qho ntawm cov kev ntsuas no tshwj tsis yog tus neeg siv tau piav qhia binary ntev dua ib feeb lub tshuab yuav rov pib dua, ib yam nkaus.

Tus saib xyuas no yuav ua haujlwm tau zoo ntawm cov qauv x86 tsis tu ncua tab sis ntawm ARM raws cov laug cam xws li Raspberry PIs, Txiv kab ntxwv PIs nws ua tsis tau kuv suav tsis txheeb. Lub kaw lus tuaj yeem nkag mus rau hauv xeev xeev uas txawm tias tus saib xyuas tau dai. Cia peb tsuas yog teeb tsa nws ib yam tej zaum nws yuav tau txais kev txhim kho nrog apt-tau nce qib ntau xyoo:(

Kauj Ruam 4: Tsim Software

Tsim Software
Tsim Software

Cov txheej txheem thaub qab nws tus kheej yog rsync raws (cov cuab yeej thaub qab zoo tshaj plaws tau tsim) cov ntaub ntawv raug thawb los ntawm SERVER-> OrangeBOX.

Kev rho tawm cov ntaub ntawv los ntawm rsync tsuas yog ib qho nyuaj ntawm txoj haujlwm kom muaj kev vam meej bar txog qhov thaub qab luam tawm ntawm LCD.

Muaj 3 txoj hauv kev los xam qhov kev nce qib thaub qab:

1, Siv cov qauv xws li https://wintelguy.com/transfertimecalc.pl los txiav txim kwv yees lub sijhawm kwv yees uas tuaj yeem hloov pauv tau

Hloov Sijhawm (d: h: m: s): 0: 02: 44: 00

Txog kev sib piv: Kwv yees kwv yees lub sijhawm xa cov ntaub ntawv 123 GB hla cov sib txuas sib txuas sib txuas (d: h: m: s): T1/DS1 kab (1.544 Mbps) - 7: 09: 01: 46 Ethernet (10 Mbps) - 1:03: 20:00 Fast Ethernet (100 Mbps) - 0: 02: 44: 00 Gigabit Ethernet (1000 Mbps) - 0: 00: 16: 24 10 Gigabit Ethernet (10 Gbps) - 0: 00: 01: 38

Yog tias rsync ua tiav nws taw tes rau tsab ntawv kom nres qhov kev suav. Txoj hauv kev no tsuas yog kwv yees kwv yees thiab tsis ntseeg tau, tseem txuas qhov nrawm tsis kho, nws tuaj yeem qeeb, ua kom nrawm dua. Qhov no tsuas yog kev xav theoretical.

2, Ua qhov ntsuas me me ntawm cov npe los txiav txim seb peb tau ua cov ntaub ntawv ntau npaum li cas. Tuaj yeem tau qeeb nrog ntau pua GBs cov ntaub ntawv me me (txawm hais tias du -s hauv Linux ua qee qhov caching yog tias koj rov ua nws)

Tus tswv A -> Cov ntaub ntawv rau cov neeg rau zaub mov kom rov qab tau cov ntaub ntawv dir: 235GB

Tus tswv B -> Txiv kab ntxwv lub thawv cov neeg siv cov ntaub ntawv peb muaj tam sim no Cov ntaub ntawv dir: 112GB

Delta yog 123 GB.

3, Yog tias cov txheej txheem cov ntaub ntawv tau mob siab rau zoo li hauv peb cov ntaub ntawv/dev/mapper/thaub qab yog peb tuaj yeem ua kom zoo dua ntawm tag nrho cov txheej txheem kev siv cov ntaub ntawv txhawm rau txiav txim siab yuav ua li cas peb thaub qab tau nce zuj zus thiab qhov no yog damn sai heev. Hauv qhov no peb tsis tas yuav tsum tau xa cov rsync stdout nyob txhua qhov chaw, tsuas yog khiav rsync qhuav, tos kom txog thaum nws ua tiav, suav cov delta hauv bytes thiab kos qhov no nrog qhov chaw dawb uas peb muaj ntawm lub thaub qab tsav thiab voila peb tuaj yeem tam sim no ua daim duab zoo bar. Nov yog txoj hauv kev kuv tau xaiv thiab ntawm no yog kuv tsab ntawv rau nws:

#!/bin/tsoo

# Thaub qab Kev Txheeb Ze Kev Nyeem Ntawv rau OrangeBOX los ntawm NLD # Version: 0.2 (2018/03/05) # # Khiav nws raws li tus neeg siv tsis raug cai los ntawm cron # * * * * * /home/orange/backup_progress.sh &>/dev/null # Tsab ntawv no yog lub luag haujlwm tsuas yog tso saib cov ntaub ntawv ntawm LCD, nws sib txuas lus # nrog cov haujlwm tseem ceeb ncaj qha los ntawm txoj haujlwm thiab kaw cov ntaub ntawv. BACKUP_DRIVE = "/dev/mapper/thaub qab" VFILE = "$ HOME/start.pos" # disk siv thaum pib thaub qab TFILE = "$ HOME/trans.size" # suav tag nrho cov kev hloov pauv loj BFILE = "$ HOME/ backup.lck " # txiav txim siab pib lub xeev FFILE =" $ HOME/backup.fin " # txiav txim siab ua tiav lub xeev LFILE1 =" $ HOME/lcd1.bar " # LCD ntsuas qhov ntsuas cov ntaub ntawv LFILE2 =" $ HOME/lcd2.bar " # LCD nce qib qhia cov ntaub ntawv SHUTDOWN = "1" # Yog 1 nws yuav pib lwm tsab ntawv uas kaw lub thawv tom kawg ntawm kev thaub qab BACKUP_CURRENT = "0" # Yuav tsum tau pib ua ntej tab sis yuav suav DRIVE_SIZE = "" # Tsav loj hauv bytes (theem nrab khij) LCD = "sudo /bin /lcd" function is_mount () {grep -q "$ 1" /proc /mounts status = $? } muaj nuj nqi liab () {sudo /bin /lcdcolor red} ua haujlwm ntsuab () {sudo /bin /lcdcolor ntsuab} ua haujlwm xiav () {sudo /bin /lcdcolor blue} # Ntshiab lub xeev (teeb tsa los ntawm bootup_display.sh). Tsis muaj kev thaub qab tab tom ua, tsis txhob cuam tshuam txog # xwm txheej LCD. Tsuas yog tso tawm qhov kev nce qib yog tias muaj kev thaub qab txuas ntxiv => Tsis pib cov ntaub ntawv THIAB Tsis muaj cov ntaub ntawv fin = txiav tawm yog tias [! -f $ BFILE] && [! -f $ FFILE]; ces tawm 1 fi # Yog tias thaub qab ua tiav cov ntawv no yuav tso tawm ntawd thiab tshem tawm cov xauv # tsis tuaj yeem rov ua haujlwm dua kom txog thaum pib ua ntej. yog [-f $ FFILE]; tom qab ntawd ntsuab $ LCD "Backup" "** Ua tiav **" ncha "Backup Ua tiav" rm -rf $ BFILE $ TFILE $ FFILE $ LFILE1 $ LFILE2 $ VFILE # Thaub qab tiav lawm ntxuav yog tias [$ SHUTDOWN == "1"]; tom qab ntawd ncha "Ua tiav kaw tsab ntawv …" /home/orange/shutdown.sh & fi tawm 0 fi # Los ntawm qhov no tsab ntawv XWB tsuas yog ua yog tias muaj ONGOING thaub qab # yog li txhua qhov yuam kev yuav luam tawm mus rau LCD thiab ua rau tsab ntawv # kom rho tawm txawm li cas los nws yuav tsis tshem cov ntaub ntawv backup.lck yog li yuav nkag mus hauv no # ntau thiab ntau dua thiab tshem tawm cov xwm txheej. is_mount $ BACKUP_DRIVE yog [$ status -ne 0]; ces liab $ LCD "ERR: Thaub qab tsav" "tsis tau teeb tsa!" ncha "Thaub qab tsav tsheb tsis tau teeb tsa" tawm 1 fi yog [! -s $ TFILE]; tom qab ntawd liab $ LCD "ERR: hloov pauv" "tsis muaj dab tsi" ncha "Thauj khoom loj suav cov ntaub ntawv tsis muaj dab tsi." tawm 1 fi BACKUP_OVERALL = $ (taub hau -1 $ TFILE | tr -d '\ n') yog [-z $ BACKUP_OVERALL]; ces liab $ LCD "ERR: Qhov loj me readback" "los ntawm server tsis raug" echo "Thaub qab tag nrho qhov loj me readback tsis raug 1" tawm 1 fi yog!

Txawm hais tias txoj cai yooj yim ntawm no yog qee qhov kev piav qhia nws ua dab tsi:

1, Yog tias BFILE lossis FFILE tsis muaj (uas yog lub xeev tom qab pib ua kom pom tseeb) uas qhia tias tsis muaj txheej txheem thaub qab yog li tsis txhob ua dab tsi tsuas yog tso tseg. Txoj hauv kev no koj tuaj yeem teeb duab cov ntaub ntawv zoo uas koj xav tau hais txog kev pib ua haujlwm zoo li lub npe host, ip, uptime thiab lwm yam thiab nws yuav tsis ua li cas.

2, Cia peb dhia mus rau is_mount $ BACKUP_DRIVE ntu. Tsuas yog ceeb toom tib txoj hauv kev peb tau txais ntawm no yog tias thaub qab tau pib yog li BFILE muaj nyob. Tam sim no tus lej tsuas yog ua ntau yam yuam kev tshawb xyuas zoo li yog lub thaub qab tsav? lossis lwm yam uas tsis raug. Nco ntsoov qhov no yog DISPLAY nkaus xwb program txawm hais tias qhov loj yuav tshaj qhov thaub qab nws yuav tsis thim dab tsi.

3, OK txhua qhov kev txheeb xyuas yuam kev tshem lub sijhawm los suav qhov feem pua ntawm daim duab. Thawj tsab ntawv yuav siv "snapshot" ntawm qhov chaw siv hauv bytes ntawm cov ntaub ntawv khaws cia tam sim no thiab khaws cia hauv VFILE. Lub hom phiaj ntawm qhov no yog dab tsi: bash tsab ntawv tsis muaj neeg nyob, nws poob cov ntaub ntawv ntawm kev ua tiav, yog li yog tias koj xav "nco" qee cov ntaub ntawv los ntawm kev ua tiav yav dhau los koj yuav tsum khaws nws cia rau qee qhov. Hauv peb qhov no tsuas yog cov ntawv yooj yim xwb. Txhawm rau ua kom yooj yim peb hais peb START_POS yog 1GB (cov ntaub ntawv peb muaj), qhov peb xav kom thaub qab yog +2GB thiab tag nrho lub peev xwm tsav yog 10GB.

4, Lub sijhawm tom ntej thaum tsab ntawv sau VFILE muaj nyob thiab qhov no yuav rov nyeem dua (yog li peb paub dab tsi yog qhov pib txoj haujlwm nyob rau hauv rooj plaub qhov tsav tsis tau khoob) hauv kev suav BACKUP_CURRENT uas yog qhov tseem ceeb ntawm qhov chaw siv tam sim no ntawm qhov thaub qab tsav rho tawm txoj haujlwm pib uas peb tau khaws cia hauv VFILE hauv qhov kawg puag ncig (dua qhov no yog cov ntaub ntawv peb muaj ntawm tsav thaum thaub qab pib). Tsab ntawv sab hauv ua haujlwm nrog bytes tab sis kom ua kom yooj yim tom qab ib nrab teev peb thim rov qab 500MB cov ntaub ntawv ces cov qauv yuav yog BACKUP_CURRENT = 1.5GB - 1GB (thawj lub xeev) => uas muab rau peb rov qab raws nraim cov ntaub ntawv tiag 500 MB, uas yog dab tsi peb thaub qab kom deb li deb. Koj tuaj yeem pom tias yam tsis tau khaws cov ntaub ntawv qub yog thaum pib ntawm kev thaub qab qhov kev suav loj no yuav ua tsis tau vim nws yuav pom tias qhov chaw siv tam sim no yog 1.5GB yam tsis paub tias 1 gig cov ntaub ntawv nyob ntawm lub disk tag nrho los ntawm kev thaub qab yav dhau los yog li nws yuav xav tias server tau xa peb 1.5GB cov ntaub ntawv hloov pauv 500MB.

5, BACKUP_OVERALL yuav raug nyeem hauv, cov ntaub ntawv no tau suav los ntawm tus neeg rau zaub mov thaum nws tau ua thawj zaug rsync qhuav (yog li qhov no yog cov ntaub ntawv sab nraud uas muaj cov lej bytes dab tsi yuav rov qab los ntawm Server-> OrangeBOX). Tus nqi no yuav raug tshuaj xyuas tawm tsam tag nrho DAWB qhov chaw ntawm daim disk tam sim no thiab yog tias nws tshaj nws ces cov lus yuam kev yuav tshwm rau ntawm lcd thiab tsab ntawv nres qhov ua tiav. Nco ntsoov ntxiv tias txhua qhov ntawv sau no tsuas yog tso tawm, nws tsis cuam tshuam nrog cov txheej txheem thaub qab. Yog tias koj ntxuav cov ntaub ntawv ntawm daim disk lossis cov ntaub ntawv hloov pauv nyob deb thiab yog li BACKUP_OVERALL hloov pauv ntawm ib kis nws yuav pib mus.

6, Thaum kawg peb tau ua tiav nrog qib thib ob kuaj xyuas nws yog lub sijhawm los tso saib qee yam. Tsab ntawv ob qho tib si qhia cov ntaub ntawv ntawm lub console thiab ntawm lub lcd siv C yooj yim app. Cov keeb kwm yav dhau yog hloov mus rau XEEB qhia tias thaub qab thaum kawg pib thiab qhov kev vam meej suav los ntawm cov qauv hauv qab no PROGRESS = $ ((($ BACKUP_CURRENT * 100) / $ BACKUP_OVERALL)). Qhov no yog qhov feem pua xam peb siv cov nyiaj tam sim no, hauv peb qhov piv txwv 0.5GB*100/2GB = 25%.

7, Cov lej kuj tseem hloov pauv los ntawm byte rau Mega/Giga bytes thiab lub vijtsam cia li qhia hauv MB yog tias nws qis dua 1GB.

8, Ib yam tseem tshuav los qhia qhov no hauv peb cov ntaub ntawv yog 25% ntawm 20 kab ntawv LCD. Qhov ntawd yuav yog 25 * 20/100 = 5 hauv peb qhov piv txwv. Tam sim no qhov kev hloov kho tshiab nrog LCD program tau ua tiav uas txhua lub sijhawm koj hu rau qhov program nws yuav rov ua dua txhua lub vijtsam. Yog li qhov xwm txheej no nws yuav khiav rau lub voj 5 zaug kom kos 5 hashmarks # ntawm lub vijtsam qhov no yuav tshwm los ua qhov tsis zoo nyob hauv txhua qhov ib puag ncig yog li ntawd kuv thiaj li sau qhov suav qhov kev nce qib cov ntaub ntawv mus rau LFILE1 thiab 2, uas hauv qhov no tom qab qhov 5 puag ncig yuav muaj ##### thiab qhov no tau nyeem rov qab thiab tso tawm ntawm LCD. Koj tuaj yeem tso LFILE1 thiab 2 ntawm ramdisk ib yam kom txuag sdcard los ntawm kev sau ntawv ntxiv, nws tsis ua teeb meem rau kuv, tsab ntawv sau ib zaug hauv ib feeb los ntawm cron.

9, Thaum thaub qab tiav lwm tsab ntawv los ntawm server uas khiav rsync yuav kov FFILE (Finish File). Ntawm lub voj tom ntej backup_progress.sh yuav pom tom qab ntawd thaub qab tiav thiab xaiv tau hu lwm tsab ntawv los kaw OrangeBOX. Nws tshem nws cov ntaub ntawv xauv ntawm qhov no ua rau kev ua tiav tsis tiav yog li txawm tias koj tsis tso cai kaw lub sijhawm tom ntej thaum cov ntawv sau no nws yuav tawm tam sim vim tias BFILE tsis nyob ntawd thiab FFILE tsis nyob ntawd. Yog li ntawd nws yuav tso saib cov ntaub ntawv thaub qab ua tiav tas mus li tshwj tsis yog thaub qab tau rov pib dua.

Tsab ntawv thaub qab tej thaj chaw deb (txiv kab ntxwv-remote.sh):

Koj yuav tsum tsim kom muaj tus lej ssh rau thaub qab thiab tus yuam sij rau luks encryption rau tsav. Thaum koj khiav cov chaw taws teeb thaub qab ntawm tus kheej thawj zaug nws yuav txuag lub thawv txiv kab ntxwv tuav tus ntiv tes rau tus tswv cov ntaub ntawv (los ntawm qhov no nws tuaj yeem ua haujlwm tau los ntawm cron).

DISK = "/dev/disk/by-id/…"

Txhawm rau kom paub koj lub cim xeeb hard disk khiav uuid, blkid lossis tsuas yog saib qhov sib xws/dev/disk/phau ntawv teev npe.

Cov npe suav nrog kev cais tawm tuaj yeem teeb tsa yog tias koj tsis xav rov qab txhua yam. Qhov no yog cov txheej txheem tsis txaus ntseeg vim tias rau rsync yog tias koj xav tshem tawm ib leeg-cov npe hauv qab sib sib zog nqus hauv cov qauv koj yuav tsum ua:

+ /ua

+/a/b +/a/b/c +/a/b/c/d -/a/b/c/d/e +/dir2

Txij li tsab ntawv no ua tiav cov lus txib ntawm OrangeBOX nyob deb nws tsis muaj kev saib xyuas ntawm qhov rov qab hloov pauv los ntawm sab ntawd, yog li ntawd kuv siv qee qhov kev txawj ntse xws li nws yuav tso tawm cov lus ntawm qhib lub chaw taws teeb tsav mus rau /tmp/contmsg.txt, tom qab ntawd cais tawm nws kom pom tias nws ua tiav, yog tias tsis yog nws hloov rsync binary mus rau qhov tsis ua tiav yog li rsync yuav tsis sim xa cov ntaub ntawv mus rau OrangePIs rootfs sau SDcard li. Kuj yog kev coj ua zoo los teeb tsa qhov hloov pauv me ntsis ntawm chattr +i /mnt /thaub qab kom ua qhov no tsis yooj yim sua.

Kev ntsuas qhov loj me yuav siv qhov chaw hauv zos ntawm Server vim li no cov ntaub ntawv no yuav tsum raug xa mus rau OrangeBOX hauv cov kauj ruam tom ntej.

Lub hauv paus tseem ceeb tau pib ua lub voj rau ((i = 0; i <100; i ++)); ua vim tias muaj qhov tsis zoo DSL/Cable txuas hauv internet rsync tuaj yeem ua rau feem ntau tawg, sij hawm dhau. Yog tias nws ua tiav tiav lub voj yuav tawg yam tsis tau sim ntau dua. Qhov no ua haujlwm tau zoo nrog kev ua haujlwm zoo, txawm li cas los xij yog tias qee qhov laj thawj lub thawv nyob deb yuav yog lub qhov rais thiab yuav muaj kev nkag mus tsis pom zoo li niaj zaus ntawm NTUSER. DAT ces rsync yuav rov ua txhaum cai thiab lub voj no yuav ua 100 zaug thiab tom qab ntawd tseem ua tsis tiav.

Kauj Ruam 5: Kaw & ToDo List

Kaw & ToDo Sau
Kaw & ToDo Sau
Kaw & ToDo Sau
Kaw & ToDo Sau

Kuv cov lus qhia qhia ib zaug ntxiv yuav ua li cas koj tuaj yeem tsim qee yam zoo dua, kho tau ntau yam cuab yeej los ntawm 10 $ khoos phis tawj ntawm koj tus kheej uas ntaus lub ntuj raug txim tawm ntawm Twm nrog nws yog tus tswv tsis raug kaw NAS cov cuab yeej, coj txawv txawv sab hauv faib, busybox crippled linux nrog segfaulting cov cuab yeej, tswj hwm los ntawm lawv lub Windows software, kaw firmware, cov ntaub ntawv tsis zoo thiab txhawb nqa thiab tsis muaj nyiaj ntau npaum li cas koj yuav siv koj yuav tsis tau txais qhov qhia tau nce qib qhia koj qhov thaub qab tsis hais txog qhov txias ntawm OrangeBox zoo li cas (Kuv txawm siv txiv kab ntxwv CAT5 cable nrog nws: D).

Nrog cov khoos phis tawj me tau dhau los ua ntau zog thiab muaj zog thaum tswj hwm tib <100 $ nqe kab peb tuaj yeem siv lawv rau ntau thiab ntau txoj haujlwm. Raws li Gbe Ethernet cov chaw nres nkoj muaj ntau heev nyob rau niaj hnub no hauv 1-2 xyoos kev nco ntawm cov laug cam no yuav nce zuj zus thiab lawv tuaj yeem siv rau ZFS raws li cov txheej txheem thaub qab ib yam.

-Fine grain qhia tau zoo los ntawm C program (saib WasserStation ib ntawm kuv lwm qhov haujlwm). Tam sim no tsuas yog # hashmark # cov cim siv hauv hom ua cim nrog lcdPuts (lcd, kab 1), qhov no tuaj yeem txhim kho txawm tias thaum siv tus cim LCDs los faib 1 kem rau 5 ntu thiab lub C tseem ceeb tuaj yeem siv tus lej zoo li 25 thiab kos tawm qhov kev nce qib kom raug lossis txhim kho ntxiv los ntawm kev siv cov duab LCD

-Muaj peev xwm kom muaj hdd tshem tau rau tsim cov thaub qab tshiab thiab tshiab thiab txav lawv mus rau qhov chaw sib txawv (yog tias lub thawv pom tias tsis muaj lub tshuab tsav ces nws yuav tsum pib kho nws nrog tus yuam sij encryption thaum nws tau txais).

-Yog koj xav luam koj tus kheej cov ntaub ntawv nrog txiagbot OrangeNAS tej zaum yuav txaus siab rau koj:

Pom zoo: