add cron command

This commit is contained in:
2020-05-17 11:13:02 +02:00
parent 82f6942ff1
commit 9acb6296e4
6 changed files with 84 additions and 11 deletions

View File

@@ -2,7 +2,7 @@ import { Writer } from 'clitastic'
import { config, VERBOSE } from './autorestic'
import { Backend, Backends, Locations } from './types'
import { exec, pathRelativeToConfigFile } from './utils'
import { exec, pathRelativeToConfigFile, filterObjectByKey } from './utils'
@@ -67,3 +67,9 @@ export const checkAndConfigureBackends = (backends?: Backends) => {
for (const [name, backend] of Object.entries(backends))
checkAndConfigureBackend(name, backend)
}
export const checkAndConfigureBackendsForLocations = (locations: Locations) => {
checkAndConfigureBackends(
filterObjectByKey(config.backends, getBackendsFromLocations(locations)),
)
}