@mtakla/cronops
    Preparing search index...

    Hierarchy

    • AbstractTask<void>
      • JobScheduler
    Index

    Constructors

    • Parameters

      • options: {
            configDir?: string;
            gid?: string;
            logDir?: string;
            shell?: string | boolean;
            source2Root?: string;
            source3Root?: string;
            sourceRoot?: string;
            target2Root?: string;
            target3Root?: string;
            targetRoot?: string;
            tempDir?: string;
            uid?: string;
        } = {}
        • OptionalconfigDir?: string

          Configuration directory where ./jobs and ./scripts are located. Defaults to ./config

        • Optionalgid?: string

          Default user used to create files and dirs

        • OptionallogDir?: string

          Directory where job logs and job file history is stored Defaults to {os.homedir}/config

        • Optionalshell?: string | boolean

          Default shell to use for exec jobs. Can be false (no shell used, direct os calls), true (use default os shell), or a specific shell like /bin/sh or /bin/bash. Default is false

        • Optionalsource2Root?: string

          Second root directory for job sources. Can be access in job config via dir: "$2/my_source_dir" Defaults to ./

        • Optionalsource3Root?: string

          Third root directory for job sources. Can be access in job config via dir: "$3/my_source_dir" Defaults to ./

        • OptionalsourceRoot?: string

          Default root directory for job sources. Can also be accessed in job source config via dir: "$1/my_source_dir" Defaults to ./

        • Optionaltarget2Root?: string

          Second root directory for job targets. Can also be access in job config via dir: "$2/my_target_dir" Defaults to ./

        • Optionaltarget3Root?: string

          Third root directory for job targets. Can also be access in job config via dir: "$3/my_target_dir" Default is ./

        • OptionaltargetRoot?: string

          Default root directory for job targets. Can also be access in job config via dir: "$1/my_target_dir" Defaults to ./

        • OptionaltempDir?: string

          Temporary directory used as target directory when running jobs in dry_run mode. Defaults to {os.tempdir}/cronops

        • Optionaluid?: string

          Default user used to create files and dirs. no default

      Returns JobScheduler

    Accessors

    Methods

    • Parameters

      • timeout: number = 1000

      Returns Promise<void>

    • Emitted if job schedule has been changed (checked every 5 seconds)

      Parameters

      • cb: (initialConfig: boolean) => void

        callback function

      Returns void

    • Parameters

      • cb: (error: Error) => void

      Returns void

    • Parameters

      • cb: () => void

      Returns void

    • Parameters

      • cb: (result: void) => void

      Returns void

    • Emitted if there was any kind of activity during job execution. The activity parameter can have the followings values:

      • EXECUTED: a command has been executed (globally or on a selected source file)
      • COPIED: a source file has been copied to path
      • DELETED: a source file (path) has been deleted by the Job
      • ARCHIVED: selected source files has been archived to path
      • PRUNED : a target file (path) has been pruned due to expired retention Note: Activity events are ony emitted, if job config property verbose is set to true

      Parameters

      • cb: (job: Job, activity: string, path: string, count: number) => void

        callback

      Returns void

    • Emitted if any error occurred during job execution

      Parameters

      • cb: (job: Job, err: Error) => void

        callback

      Returns void

    • Emitted if manual job execution has been started via executeJob(). Note: This event is not emitted, if the job is paused or already running

      Parameters

      • cb: (job: Job) => void

        callback

      Returns void

    • Emitted if the job has been finished

      Parameters

      • cb: (
            job: Job,
            stat: {
                archived: number;
                copied: number;
                deleted: number;
                durationMs: number;
                endTime: number;
                errors: number;
                executed: number;
                pruned: number;
                startTime: number;
            },
        ) => void

        callback

      Returns void

    • Emitted if the job has been successfully scheduled

      Parameters

      • cb: (job: Job, rescheduled: boolean) => void

        callback

      Returns void

    • Emitted if the job has been started by scheduler or triggered manually via executeJob()

      Parameters

      • cb: (job: Job) => void

        callback

      Returns void

    • Parameters

      • cb: () => void

      Returns void

    • Parameters

      • cb: () => void

      Returns void

    • Parameters

      • runImmediately: boolean = false

      Returns void

    • Schedules a single job

      Parameters

      • job: Job

        job definition

      Returns void

      JobError if job definition is not valid

      JobError if Job config is not valid

    • Parameters

      • jobs: Job[]
      • Optionalcb: (count: number) => void

      Returns void