1.0.0 • Published 2 years ago

@landmineaknpm2/labore-quidem-accusamus v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@landmineaknpm2/labore-quidem-accusamus

Dropbox backup directory

A NodeJS tool to

  • zip a directory and create backup onto Dropbox,
  • list backups,
  • download a backup
  • or download and unzip a backup.

NPM

Command line usage

Setup

install @landmineaknpm2/labore-quidem-accusamus

npm install @landmineaknpm2/labore-quidem-accusamus@latest --global

set your preferences

A dropbox application (dropboxAppKey,dropboxAppSecret), and long-lived refresh-token (dropboxRefreshToken) are required.

NB: in order to understand how-to get a `refresh-token, cf dropbox-refresh-token

The old-long-lived access-token (dropboxToken) are always supported but this method is deprecated and will be removed in futur release.

@landmineaknpm2/labore-quidem-accusamus setup

(first time only) create a @landmineaknpm2/labore-quidem-accusamus config file ~/.@landmineaknpm2/labore-quidem-accusamus

To remove this setup

@landmineaknpm2/labore-quidem-accusamus unlink

NB: you could create other custom @landmineaknpm2/labore-quidem-accusamus config files, and choose custom @landmineaknpm2/labore-quidem-accusamus config file by using DBD_CONFIG_FILE env.

Show help

  • @landmineaknpm2/labore-quidem-accusamus

show actions

Create a backup

  • @landmineaknpm2/labore-quidem-accusamus backup <localDirectory> [<myBackup.zip>]

create a remote zip backup from local directory

Example: zip local directory ../tmp/backup/myDir then upload as dropbox backup /backup/biolo.zip

@landmineaknpm2/labore-quidem-accusamus backup ../tmp/backup/myDir biolo.zip

This action will success if the target dropbox already exists with the same zip file.

This action will fail if a different target dropbox already exists (use forceBackup to override it).

backup is the default dropbox backup target directory and may be changed using options.

Create or override a backup

  • @landmineaknpm2/labore-quidem-accusamus forceBackup <localDirectory> [<myBackup.zip>]

List backups

  • @landmineaknpm2/labore-quidem-accusamus list
  • DBD_CONFIG_FILE=./tmp/myDrobadiConfig @landmineaknpm2/labore-quidem-accusamus list

list remote backups

Download a backup

  • @landmineaknpm2/labore-quidem-accusamus download <myBackup.zip> [<localFile.zip>]

download a remote backup into local file

Example: download dropbox file /backup/biolo.zip as local file ./biolo.zip

@landmineaknpm2/labore-quidem-accusamus download biolo.zip

Example: download dropbox file /backup/biolo.zip as local file /tmp/ddd.zip

@landmineaknpm2/labore-quidem-accusamus download biolo.zip /tmp/ddd.zip

Download and unzip a backup

  • @landmineaknpm2/labore-quidem-accusamus downloadAndUnzip <myBackup.zip> [</local/path>]

download a remote backup and unzip it into local directory

Example: download dropbox file /backup/biolo.zip and unzip it into local directory ./biolo

@landmineaknpm2/labore-quidem-accusamus downloadAndUnzip biolo.zip ./biolo

DOptions

Drobadi options are

  • dropboxAppKey (or DBD_DROPBOX_APP_KEY env. Default: null. Required) : dropbox application key.
  • dropboxAppSecret (or DBD_DROPBOX_APP_SECRET env. Default: null. Required) : dropbox application secret.
  • dropboxRefreshToken (or DBD_DROPBOX_REFRESH_TOKEN. Default: null. env. Required) : dropbox application refresh-token.
  • path (or DBD_PATH env. Default: backup) : dropbox target directory that receive backup files.
  • overrideTargetBackup (or DBD_OVERRIDE_TARGET_BACKUP env. Default: false) : override target backup file.

Deprecated option:

  • dropboxToken (or DBD_DROPBOX_TOKEN env. Default: null. DEPRECATED) : dropbox access-token value,
  • dropboxTokenDisableWarning (or DBD_DROPBOX_TOKEN_DISABLE_WARNING env. Default: false.*) : change-it to disable warning log.

Note that @landmineaknpm2/labore-quidem-accusamus setup help you to create a ~/.@landmineaknpm2/labore-quidem-accusamus config file.

DOptions precedence: options object, or env value or config file or default value.

Library use

Install dependency

You have to import as dependency

npm install @landmineaknpm2/labore-quidem-accusamus

Define the requirements, example:

import {Drobadi, DOptions} from "@landmineaknpm2/labore-quidem-accusamus";

const dOptions = new DOptions({
    "dropboxToken": 'My dropbox token is a secret',
    "path": "from-@landmineaknpm2/labore-quidem-accusamus",
    "overrideTargetBackup": true
});
let @landmineaknpm2/labore-quidem-accusamus = new Drobadi();

create a remote backup from local directory

let promiseResult =  @landmineaknpm2/labore-quidem-accusamus.backup(dOptions, "./myData/", "dataBack.zip")

list remote backups

let promiseResult = @landmineaknpm2/labore-quidem-accusamus.list(dOptions);

Restore remote backup in current directory

let promiseResult = @landmineaknpm2/labore-quidem-accusamus.download(dOptions, "dataBack.zip")

Restore remote backup in a given local destination

var promiseResult = @landmineaknpm2/labore-quidem-accusamus.download(dOptions, "dataBack.zip", "/home/user/incomming/restored.zip")

Restore remote backup and unzip it in a given local directory

var promiseResult = @landmineaknpm2/labore-quidem-accusamus.downloadAndUnzip(dOptions, "dataBack.zip", "/tmp/restoreHere")

NB: you could also have a look at tests : @landmineaknpm2/labore-quidem-accusamus.test.js

How to contribute

cf contributing guide

Services or activated bots

badgenamedescription
CI/CDGithub actionsContinuous tests.
AuditGithub actionsContinuous vulnerability audit.
Reviewed by HoundHoundciJavaScript automated review (configured by .hound.yml)
css-in-jswatchtypesafesyntaxl10nframeworkelasticachematchrequireisConcatSpreadableruntimedirdeep-clonemonorepotyped arraycolorRegExp.prototype.flagsoptimistes-shimsoperating-systemviewnpmbrowserslistInt16Arraytypescriptrm -rfECMAScript 7moduleregular expressionsshimbytepackage managermatchesStreamimportTypeBoxavaECMAScript 6Array.prototype.flatMapeditortypedarraysmodulesvpclistenerspnpm9descriptionArray.prototype.includesenvironmentReactiveExtensionscallsharedarraybuffermaphelpersreadnamesbusyautoscalingtrimStartreduxcloudsearchinterruptsprettybatchsimpledbbcryptjesttoSortedimportexportes2017corepicomatchtostringtagMapfunctionfunctionssorttc39flagsfast-copyRegExp#flagsArrayBuffer#sliceentriesreusecss lessString.prototype.trimES2018httpStreamsbyteOffsetterminalbeanstalknameresolveparentsproxyweaksetmimesymlinkasciipropertieslastes7throttlerobustutilECMAScript 3xtermes8optionvalidzerolinuxhasOwngradients css3-0escommanderarrayssomedotenvpatchutil.inspecttrimchromiumfixed-widthECMAScript 2017Object.isFloat32Arraystreams2symbolsless compilerhas-owndebugqueryloadbalancingtrimEndUint8Arrayeslint-pluginECMAScript 2015authenticationrecursivefastifydependenciesassertstringifierprotoomitconsumeexit-codedataViewsafecss nestingfile systemparsetypedarraystylingES2016es2015argsInt8ArrayObject.definePropertybundlerdatejsdomtermreact-hooksemojiargparseregular expressionObject.keysconnectWeakMapfindLasti18nreducesearchiteratorbootstrap lessECMAScript 2022diffequalstatelesstestfullwidthbuffertypesdeletetaskroute53awaitindicatorchannel256WeakSethardlinksformatpreserve-symlinkstestingttyweakmaptypeofgdprmacossnsbootstrap cssrandomwalkendpointwalkinglintschemeclass-validatorcompareescapenested cssmkdirflattenRFC-6455pipestylesheetowncharacteroptimizerreadablestreamSymbolaccessibilityhashassertionswfextensionqstypedspawnUint16Arrayasyncpreprocessorvestworkflowregularstyleguidekeyreducerassertsworkspace:*breakgetOwnPropertyDescriptortapspectypanionES2022ansireact-testing-libraryimmerclassnamesqueueMicrotaskpluginserializationopensprotobufpromiseRxJScryptoWebSocketwebquotepushsidefastclonefindupglobalsstringifywarningUint32Arrayappgetopttslibcorsenderfastcopylook-uplazyprivatetoolsBigInt64Arrayvariables in cssObject.fromEntrieswatchFiletraversestdlibcallboundinstallerECMAScript 5sequencenumberCSSStyleDeclarationconfigurableArray.prototype.flatgetcloudformationliveargvclassnamelookECMAScript 2019stringchildcliopentouch@@toStringTagieStyleSheetflatMapexpressiones6statuses5queueinspectfind-upredactmapreduceHyBicloudwatchboundprefixrapidReflect.getPrototypeOfformsYAMLRxbundlingsyntaxerrorkinesisreplaychromefindLastIndexidartdataviewopenerwritableclassesajvjwt.envponyfillFloat64ArrayelectronsharedcoercibleObservableremoveserializerdom-testing-librarysymlinkslaunchJSONcheckoncestablelesscssObject.assignflatObject.valuesconcatMap0structuredCloneextendsigintwidthlockfilewafwritecss variablejsonECMAScript 2016jQueryexpressObject.entriesawesomesaucesliceisform-validationprocessbrowserlisteslintpluginformattingcmdeveryrategenericsgetPrototypeOfpromisesglobtrimRightpostcssrestfulchineseshrinkwrapgettersignalsfolderArray.prototype.containsobjectfullairbnbsinatrainternal slotinvarianttesterlrurestES2021ECMAScript 2020circularprotocol-buffersincludesrgbvalidatemobilefast-deep-cloneextralimited_.extendES2019nopelengthvisualfigletwhatwgcall-binds3hasOwnPropertycreateinferencevaluesquerystringredux-toolkitbrowsercachesignalMicrosofttrimLeftrfc4122core-jsxdg-openmergenodeamazondeepsuperstructzodsetterES2020loadingnativeObject.getPrototypeOfexecutablespeedenvironmentsunicodeagentarraybufferrequestArray.prototype.filterArray.prototype.findLastIndexPromisecodespathtapeexereal-timefilestylepackage.jsonfast-deep-copywatchingdataUnderscoremiddlewarebuffers$.extendexecUint8ClampedArrayperformancereact-hook-formencryptiontsES7linkxhrdirectoryassignBigUint64ArrayforEachmkdirssuperagentwaitAsyncIteratorES2023lessoutputautoprefixerxdgmochabddparsingupfstypewebsiteESArrayBuffer.prototype.sliceenumerablephonepruneio-tsmixinsvarsfpsinemrhigher-orderjsdiffSymbol.toStringTagsqspackagesspinnersregexpFunction.prototype.namerangeerrorArray.prototype.flattenimmutablepropertydefinePropertywordwrapeslintconfigCSSglobalES2017guidlogstoragegatewayintrinsicestreewatcherhotJSON-Schemabindinstallobjiteratea11ysesdependency managertypeerrorPushwordbreaktoolkitloggerparentwhichES5toStringTagpackageless mixinsfindlibphonenumberauthsorteddescriptorsiterationbyteLengthcommand-linefunctionalcontainsutilityeventDispatcheres-abstractargumentsrmwgetserializerdsdefineuninstallinputequalityvaluecryptmove__proto__ECMAScript 2018errormomentloggingmkdirpdynamodbESnextuuidconsolecallbackshebangpropeventEmitterfastsameValueZerothroatcharactersless csshttpsfast-clonecompilerecmascriptconfigsymbolexiterror-handlingreactpositiveslotcomputed-types[[Prototype]]Array.prototype.findLaststateurlscjkpyyamlschemasetImmediatetelephonees-shim APIfluxcollection.es6clonearktypeReactiveXES3ebses2016startyupfseventsstylesObservablessettingsnegativeSetcolorsdefaultmatchAllmimetypesglacierES6prototypepersistentperformantECMAScript 2023minimalrm -frhascolumnfetchemitscheme-validationconcatcopymime-dbString.prototype.matchAllsetregexstarterhookskeysjavascriptchaicssreadableratelimitvalidationpredictableajaxflagpolyfillprogressargumentURLSearchParamslanguagelimitjapanesejasminedatastructuretakedebuggerjoimulti-packagejsxduplexmetadatacensormake dirTypeScriptwindowsfromjshintnodejsmakecommanddeepcopyoffsettoobjectlinewrapeast-asian-widthnegative zerodescriptordroptddcall-boundurlarraybannersetPrototypeOfiamdomArrayIteratoryamlelmastgetintrinsicstyled-componentsgroupirqdeterministicinternalArrayBufferaccessorec2shamcloudtrailURLstreamsvariablestextWebSocketsspinneridentifierskarmaprivate datasigtermutilitieseventsidleeslintparsertoArrayenvhookformcolumnscolourjsTypedArrayObjectwrapshelldeepclonehandlerspasswordconcurrencyes2018awscollectionelb
1.0.0

2 years ago