uci-utils-sync/example/example.js

20 lines
444 B
JavaScript
Executable File

import Sync from '../src/sync.js'
import onDeath from 'ondeath'
(async () => {
const sync = new Sync({jobsDir:'./example/jobs'}) // look for job files here
await sync.runJob('remote')
// await sync.loadJob('local')
sync.watch('on')
console.log('ready and waiting')
onDeath( () => {
console.log('\nHe\'s dead Jim')
sync.watch('remove')
})
})().catch(err => {
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
})