Overview

I previously created a program to download Omeka S data.

This time, I use AWS Copilot to run the above program on a scheduled basis.

Installing AWS Copilot

Please refer to the following.

https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/AWS_Copilot.html

Preparing Files

Create three files in any location: Dockerfile, main.sh, and .env.

Dockerfile

FCCROMOPDMYsphy.tsmhhaoin.n:.3sh

main.sh

se#edd#if#gg#cpp#cs#omccc#gggggg#crrexxiifiiidiidhdkdppiiiiiidmmtpPprrIrrcttrppEcidgttttttCoro__f[mmle$xsmori$--il---rortdoccqdiierap=rorrtsacccperretgtoaf---nlluinncciy.dtdooouaffrotodrreooirssun.-iadnnmsnoarlalffnnr_ttt./prtffmhu$$ume=sd$eeetaaes.u.iiipddtpteed$$mollh.$sggtiiptootriddeoll/orruo_o=rii--nl$d/uu-__ttlde_rrddt-di$$ssmtd_doaxt__ees-rirddeeoadootiotdpp.uriirr"otiwlasooatttpr_rr..ularn=stlothhxged__enps=lheslatrqattmade.ott]s11autooamat.at;ediaooiet/dpt$$ersllledstrree//""od:heepmtdd"$ca/eppie/ao$nst/noopn$tceaag__tsasmmitdsuaeftoa.b..i"rhottdloulaxi"mbstr.$eOcdtmoiemr$k/_dantiaorSko_aldmautraas1e9t6/omekas_backup.git

.env

aguedpismiitear_hrinuunlarba=ml_mne=uea=hr=kdtlnaet=amvphkustar:tma/pu@/sred:axe/am<poplmeeer.ksoaor.ngoarlg-/aocmceeksas--st-oskaennd>b@ogxi/tahpuib.com/<username>/<repository-name>.git

The following is an explanation of the parameters.

ItemDescriptionExample ValueNotes
api_urlURL of the target Omeka S APIhttps://dev.omeka.org/omeka-s-sandbox/api-
github_urlURL of the destination GitHub repositoryhttps://@github.com//.gitBy including a Personal access token, you can push the program’s output to the GitHub repository.
usernameUsername for commitsnakamura-
mailEmail address for commitsnakamura@example.org-
dirnameDirectory to create in the destination GitHub repositorydev-

Running AWS Copilot

Run copilot init as follows. You need to answer several questions, but this alone enables deployment to Amazon ECS.

%D%WtcUAWJDSRONYADoeoospooocakoolelcclneprbchtCTtWuClpskochtlkkeegrherrrlepoeaeilned:ree:oerorimlixcoarueatmaiyflepniaamfl1atdAeatg:ioestdeiehteirnehlttyrti:l,drctidtNeooiiotetehhf,oiuznnyo:ywtcieeEmntegpmpehttsCyaihgdneee'eoemtRoiteeaa:k/:lrcauntspmaDliytncr'.CepeSsoRnuioersosrl:c-casfcrfnpehpevihbkteroeetoiticoeaeetapsasalcamdcrsittiiloueteukfutlyntltpsikluipropfsooaepluteorsCwtnsd-eacrcieLih:-jtwaoetItabJoSuirjns!htNaobcrlmoffocbhel6bifoWaoke4gorepudthour'cepuoohmrlrorllaeajoenaemdsktocttdaaibagaensbsoloiJaee-nointogrebsmdneobevnaeegrgiclkvienscdkiaetztaeeeuksloehmrtpe-odeevme-bpwrdiacjyamaa.cntoocelpoeiebuknkpmsfdrutlee.ap.yikastc-ocantWojuasdsecnot-otbtibjfwpa.hoaooiiirncbrllnoksloeuouatrgnpups/h-npeosAjdltmisWoeiezoSbrcpkem.alaeiatasaAnpit-nqnpofbdualnoaeapircjsppcomkotplamubilite'poicikl-sncaoaijcsatnsnohti-ubeioobxdonmamunecxalokk8neimau6isesp_f(k-.6e@aab4sesa'tvc-c.eobkiyrlaunmylcpslek.t1cuehtpa)id.or.nunIonffinygouo'ndtrhaethsecrhebduuilled@aenvderryun1ha.sarchitecturetypearm64,pleasechangethe'platform'fieldinyourworkloadmanifestto'linux/arm64'.

After running the above, add the following to the end of copilot/{service name}/manifest.yml to add environment variables.

####nt#eaynTRYmpAvhehoeed_eatu::dfdtrimpoStlatsjmchenh:oehe:ie/bkef/adf.efansuoesuwa-llntlsmbelvl.eadofgcwosiwkJirptiuonehlpbgtcul-hibjef.boiieb"cooa/umtcseioekopdanisli-fonbotar-nccaktlmuhiipe/n-dgj"ooScybcso"h/uemrjdaounrblie.efsdeosuJtro/cbse"cshtelydipukeleeadlt-o:jgobg/roups,ECSTasks,etc.

After that, deployment is possible with the following command. This command can also be used to update when files have been modified.

%copilotdeploy

Summary

I introduced a method for periodically backing up Omeka S data using Amazon ECS. We hope this is helpful for backing up Omeka S data.