Sida otomaatig loogu sameeyo kaydka Windows Server ee Amazon S3

Xalka Kaydinta Fudud ee Amazon (Amazon S3)(Amazon Simple Storage Solution (Amazon S3)) wuxuu kuu oggolaanayaa inaad ku kaydiso xogta Windows Server -kaaga kaydinta daruuriga ah ee weyn. Kaydinta xogtaadu waa muhiim, maadaama ay ka hortagayso luminta xogta haddii ay dhacdo dhacdooyin lama filaan ah.

Summada Server-ka Windows

(Automate Windows Server)Si otomaatig ah ugu samee kaydinta Windows Server ee Amazon S3

Casharradan, waxaan ku tusi doonaa sida loo habeeyo habka kaydinta si uu u shaqeeyo hal mar, maalin, toddobaadle, ama bishiiba. Qalliinku waa mid toos ah, laakiin waa inaad si dhow u raacdaa hagaha si aad uga fogaato dhibaatooyinka.

Ku rakib Amazon AWS CLI

Talaabada ugu horeysa ee otomatiga ah ee kaydinta Amazon AWS(Amazon AWS) waa in lagu rakibo AWS CLI . Waxaad ka heli kartaa tilmaamo faahfaahsan oo ku saabsan rakibidda nooca AWS CLI 1 iyo 2 ee boggan(this page) .

Markaad dhamaystirto rakibaadda, hadda waa inaad dejisaa profile-yada isticmaale ee caadiga ah, aqoonsiga gelitaanka, iyo furaha. Si tan loo sameeyo, ku socodsii amarka hoose:

aws configure

AWS Access Key ID [None]: <AccessID>

AWS Secret Access Key [None]: secretkey

Default region name [None]: us-east-1

Default output format [None]: json

Ku saabsan amarrada Amazon S3

Amazon S3

Waa inaad ku qeexdaa dooda dariiqa amarrada s3. Wadooyinkan, waxaad isticmaali kartaa mid ka mid ah S3 Uri , kaas oo ah S3 baaldigaaga URI ama isticmaal waddo maxalli(localpath) ah (tusaha deegaanka). Tusaale ahaan, waxaad isticmaali kartaa amarrada soo socda:

localpath - C://Desktop/backups

S3URI: - s3://yourbucket/yourkey

Hawlgalka S3 oo dhammaystiran waxa uu qaadan karaa foomkan:

aws s3 s3command souce_file/folder destinationpath

Hawlgalku waxa uu ka baxaa  dariiqa maxaliga(S3URI) ah ilaa S3URI(localpath)S3URI ilaa  S3URI , iyo  S3URI  ilaa  wadada maxaliga(localpath) ah .

Si aad u koobiyayso faylka tusaale ee loo yaqaan  samplefile.txt baaldigaaga loo yaqaan sample-backet(sample-bucket) , waxaad isticmaali kartaa amarka S3 ee hoose:

aws s3 cp "C://Desktop/backups/samplefile.txt" s3://sample-bucket

Amarka sare, ma aynaan dooran gobol. Tani waa sababta oo ah waxaan horayba u samaynay taas  aws configure . Calanka  gobolka(–region) waxaa loo isticmaalaa in lagu qeexo gobolka baaldigaaga.

Si aad u koobiyayso wax kasta oo ku jira  galka kaydinta (backups)baaldiga muunada-(sample-bucket) baaldiga, socodsii amarka soo socda:

aws s3 sync "C://Desktop/backups/" s3://sample-bucket

Si aad u isticmaasho amarka S3 ee kore, u fiirso kuwan soo socda:

  • Faylka deegaanku waa inuusan ku jirin baaldiga la doortay iyo horgalaha.
  • Hubi in cabbirka shayga S3 uu ka duwan yahay kan faylka deegaanka.
  • Wax ka beddelkii ugu dambeeyay ee shayga S3 waa inuu ka weynaadaa kan faylka maxalliga ah.

Talooyin ku saabsan isticmaalka calamada shaandhada ee amarrada S3

Calaamadaha shaandhaynta ee aad ku isticmaasho amarada S3 waxa ka mid ah  -ka- reebista(–exclude) iyo  -ku(–include) -darka calanka. Waxaad ku isticmaali kartaa dhowr jeer hal amar.

  • -- includeTani waxay ku daraysaa galka ama faylasha la doortay ee raacaya amarka S3.
  • -- excludeTani waxay meesha ka saaraysaa galka ama faylasha la doortay ee raacaya amarka S3.

Hoos(Below) waxaa ah tusaale filtarrada sare ee la isticmaalo:

aws s3 sync "C://Desktop/backups/" s3://sample-bucket --exclude "*" --include "*.jpg" --include "*.png" --include "*.txt"

Si aad uga saarto fayl kasta oo ku jira galka loo yaqaan '  backups ' oo lagu daro dhammaan faylasha ku jira galkan kuwaas oo leh kordhinta  jpg, png, iyo qoraalka(jpg, png, and text) , socodsii amarka hoose.

Halkan, waxaan sidoo kale ku tijaabinay goobahayaga anagoo kaashanayna --dryruncalanka:

aws s3 sync "C://Desktop/backups/" s3://sample-bucket "*" --include "*.jpg" --include "*.png" --include "*.txt" --dryrun

FIIRO GAAR AH: (NOTE: ) Calamada la'aanteed, nidaamka waxaa ku jira fayl kasta oo ku jira hawlgallada S3. Sidoo kale, filtarka ugu dambeeya ayaa la mariyaa.

Sida loo abuuro kaydka Amazon S3 iyadoo la isticmaalayo faylal dufcad ah

1] Samee faylka dufcadda

Fur Notepad si uu u furo fayl .txt maran.(.txt)

Si otomaatig ah ugu samee kaydinta Windows Server ee Amazon S3

Geli(Enter) amarka soo socda ee S3 si aad ula midayso faylalka kaydinta baaldigaaga S3:

aws s3 sync "C://Desktop/backups/" s3://your-bucket

Ku keydi faylka txt ee  kordhinta .bat , taasoo ka dhigaysa fayl dufcad ah.

2] Abuur(Create) hawl cusub Jadwalka Hawsha(Task Scheduler)

u samee shaqo jadwal sameeye si toos ah amazon s3 backup

Riix(Press) furaha Windows oo raadi  jadwaleeyaha hawsha(task scheduler) .

Ka dooro  Jadwalka Hawsha(Task Scheduler) natiijooyinka

Jadwalka Hawsha, dhagsii  Hawlaha(Actions) oo dooro Hawsha Abuur(Create Task) . Geli magaca hawsha oo qor sharaxaad.

Ku dar kiciye hal mar, maalin, toddobaadle, ama bishiiba.

3] Ku dar ficil

U  beddel tabka Actions oo ka dooro tallaabada soo socota liiska hoos u dhaca: Bilow barnaamij(Start a program) .

Sanduuqa  Program/script , ka raadi faylka cusub ee la sameeyay.

Badbaadi hawsha cusub ee la abuuray.

Waxaan rajaynayaa inaad casharkan u fududayso in la fahmo.



About the author

Waxaan u shaqeeyaa lataliye ahaan Microsoft. Waxaan ku takhasusay horumarinta barnaamijyada mobaylada ee aaladaha Apple iyo Android, waxaanan sidoo kale ka qayb qaataa horumarinta barnaamijyada Windows 7. Waayo-aragnimadayda taleefannada casriga ah iyo Windows 7 waxay iga dhigaysaa musharax ku habboon booskan.



Related posts